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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-19 : 05:38:49
|
| kala writes "This is my query.SELECT BillNoFROM Bill_LedgerWHERE (CompanyID = 'BM') AND (LedgerID = '0753')ORDER BY BillNoBillNo field is of datatype varchar and size is 20.I liked to order by BillNo field in Ascending order.Characters are sorted in ascending order but Numbers are not sorted ascendingly.I want the solution please." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-19 : 05:44:33
|
| Posting some sample data with expected result would be helpfulIf you have fixed length of data, then this will workSELECT BillNoFROM Bill_LedgerWHERE (CompanyID = 'BM') AND (LedgerID = '0753')ORDER BY len(BillNo), BillNoMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|