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 |
rookie_sql
Constraint Violating Yak Guru
443 Posts |
Posted - 2010-06-24 : 11:24:08
|
Hi i've a dataset called week which is order by week num,ber ASC that i use to populate a drop down list to filter my report by week number. Each time i run the query the week_no is ordered like 1101112.I'd like to get the sorting as 1234. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-06-24 : 11:47:47
|
Is it possible to convert the column to int in the ORDER BY?Because the actual sort looks like the column datatype is varchar or so. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
rookie_sql
Constraint Violating Yak Guru
443 Posts |
Posted - 2010-06-24 : 12:28:01
|
Aye that was the problem i went back to the table and the col was set to Varchat i converted it to an int and it worked.thanks |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-06-24 : 14:18:34
|
glad to help  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-06-24 : 14:36:43
|
Or...ORDER BY LEN(WeekNum), WeekNum N 56°04'39.26"E 12°55'05.63" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|