OrthoDocSoft
Programmer
Folks,
I store a date in my MS SQL Server 2005 as a date type.
My query goes something like:
"SELECT * from mytable ORDER BY [date]"
But the order I get looks like this:
8/1/2011
8/13/2011
8/2/2011
8/5/2011
(notice that 8/13 should come after 8/2 and 8/5...)
etc., so it is ordering by the "digits" (ones before twos) but not the date, if you see what I mean.
Is there an easy way to make this work?
Thank you!
Ortho
"you cain't fix 'stupid'...
I store a date in my MS SQL Server 2005 as a date type.
My query goes something like:
"SELECT * from mytable ORDER BY [date]"
But the order I get looks like this:
8/1/2011
8/13/2011
8/2/2011
8/5/2011
(notice that 8/13 should come after 8/2 and 8/5...)
etc., so it is ordering by the "digits" (ones before twos) but not the date, if you see what I mean.
Is there an easy way to make this work?
Thank you!
Ortho
"you cain't fix 'stupid'...