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 |
|
vectords
Starting Member
3 Posts |
Posted - 2003-11-19 : 09:47:24
|
| Again, Hi everybody,I have onde table called (TB) with two fields : F1(int) and F2(varchar:10)In this table the field F2 is used to store dates in the formatdd/mm/yyyy (27/12/2002). It´s is record as varchar and undesired.I need to select all records from a single id from the field F1 and then order by the result set by date to result set be this way:To do this I´m using the follow syntax :SELECT * FROM TBWHERE (F1 = '01')ORDER BY CONVERT(varchar(10), F2, 103)My problem is that the result set isn´t order by displaying as follow :F1 F2--------------------------------------01 05/07/197501 07/01/200001 12/12/198501 13/12/1998 --------------------------------------I need a real ordey by date to get the follow result set for this select :F1 F2--------------------------------------01 05/07/197501 12/12/198501 13/12/199801 07/01/2003 --------------------------------------If there´s someone to solve this problem I´ll be thankfullmore one time...thanks for attetion |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2003-11-19 : 09:55:33
|
| [code] order by convert(datetime,F2,103)[/code] |
 |
|
|
|
|
|