Thursday, July 26, 2007

Replacing dates to sortable strings in SQL

Try this:

select replace(replace(convert(nvarchar(19),@Date,120), ':',''), ' ', '_')

No comments: