Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
velnias2010
Posting Yak Master
125 Posts |
Posted - 2011-05-04 : 09:27:27
|
| I have the following query SELECT *FROM tbHRI_Race AS r INNER JOIN tbHRI_Meeting AS m ON r.MeetingNum = m.MeetingNum INNER JOIN tbHRI_Venue AS v ON v.RA_Venue_id = m.RA_Venue_idWHERE (r.ResultsIn = 'Y') AND (r.RA_race_cancelled_ind_id <> 'Y')ORDER BY m.RA_Meeting_Date_dt DESCIn which RA_Meeting_Date_dt is a datetimeNow the issue is, that it doesnt seem to be ordering correct i.e2011-04-29 00:00:00.000is above 2011-05-03 00:00:00.000how could this be possible ? |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-05-04 : 09:30:21
|
| April 29th comes before May 3rd.JimEveryday I learn something that somebody else already knew |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-05-04 : 09:31:28
|
| P.S. You may need to SET DATEFORMAT mdy or whatever.JimEveryday I learn something that somebody else already knew |
 |
|
|
velnias2010
Posting Yak Master
125 Posts |
Posted - 2011-05-04 : 09:32:31
|
| Yup I know this.But I have I ask for Date descending I would wantMay 3rdApril 29thMy question was why am I getting backApril 29thMay 3rd |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-05-04 : 09:35:23
|
RA_Meeting_Date_dt confirm is a datetime ?If the ordering is as what you said, it looks to me that the column is a string KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2011-05-04 : 23:09:52
|
| You've clearly editied it. Can you post the actual query & output?Have you removed a TOP clause anywhere before posting? If so that could be the cause of your problem. |
 |
|
|
|
|
|