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 |
joemama
Posting Yak Master
113 Posts |
Posted - 2007-04-13 : 18:14:14
|
i have a dynamic sort feature that works fine using CASE...but i need to convert the NVarChar to date time can anyone help me with it?CASE WHEN @SortBy = '4up' Then Convert( VarChar( 100 ), dbo.Tbl_BaselineAppt.BaseDate ) END ASCthanks |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-04-13 : 18:20:05
|
what is the error message?************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
|
|
joemama
Posting Yak Master
113 Posts |
Posted - 2007-04-13 : 18:25:21
|
there is no error message..i just want to know how to convert that statement to datetimequote: Originally posted by dinakar what is the error message?************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/
|
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-13 : 18:34:08
|
Convert( VarChar( 100 ), dbo.Tbl_BaselineAppt.BaseDate, 120 )Convert( DATETIME, dbo.Tbl_BaselineAppt.BaseDate )Peter LarssonHelsingborg, Sweden |
|
|
joemama
Posting Yak Master
113 Posts |
Posted - 2007-04-13 : 18:53:49
|
you rock...thanksquote: Originally posted by Peso Convert( VarChar( 100 ), dbo.Tbl_BaselineAppt.BaseDate, 120 )Convert( DATETIME, dbo.Tbl_BaselineAppt.BaseDate )Peter LarssonHelsingborg, Sweden
|
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-04-13 : 19:02:27
|
If you are dependent of milliseconds, use 121 instead of 120.Peter LarssonHelsingborg, Sweden |
|
|
|
|
|