var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: select only date from datetime field
I know there must be a way to do this....
I want to select only the date portion of a datetime field. the date normally shows as similar to '2004-01-01 09:39:52.000'
I need to return just '2004-01-01'. using convert and cast returns the dates as 'JAN 01 2004' - this won't sort correctly, so it is of no use. any suggestions?
select convert(char(10), @YourDate, 120)
if all you need is a character representation. You can also use:
SELECT Convert(CHAR(10), GetDate(), 121)
if you need a "real" date to come back.
SELECT Convert(DATETIME, Convert(CHAR(10), GetDate(), 121))