in the SqlDataSource, I have specified a SelectCommand that retrieves a date:
SelectCommand="SELECT [training_id], Convert(varchar(14),[trainingDate],101) FROM [tbl_training]"
However DateGenerated gives me a value like 11/04/2011 12:00:00 AM. How do I extract only 11/25/2011 using SelectCommand?
Any help would be appreciated.
Don’t specify a size, try
If you were to run this on SQL Server for today you would get:
Result:
11/04/2011
Its also worthwhile to note in SQL Server Denali all these magic numbers for formatting will go away with the new FORMAT() function