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 |
|
dani2
Starting Member
32 Posts |
Posted - 2008-10-08 : 02:30:34
|
| For some reasons a table string column contains values of null and '1-1-0001'. When converting those to datetime arithmetic overflow error is raised. How can I avoid such values in the select query?Thank you. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-10-08 : 03:06:44
|
| You can for example use ISDATE() in your WHERE-Clause.ISDATE() returns 0 when the given value is not a date.Examples:select isdate('1-1-0001') --> returns 0select isdate(null) --> returns 0select isdate('20081008') --> returns 1add to your SELECT something like this:Where ...and isdate(yourcolumn) = 1GreetingsWebfredPlanning replaces chance by mistake |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|