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 |
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2010-04-23 : 12:26:12
|
Is there is a way to check if timestamp field is Null or Nothing?I tried this:timestamp_field is Null or timestamp_field is Nothing it gives error: Error converting data type DBTYPE_DBTIMESTAMP to datetime.Thank you. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-04-23 : 12:33:00
|
I know "Nothing" from VB.Is it possible to use it in T-SQL?Have you tried isnull(timestamp_field,'') <> '' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2010-04-23 : 13:49:08
|
| This is T-sql, I've tried every option I can think of. Maybe I need to convert the field to something else before I can check the value for Null. I'm not sure. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
snufse
Constraint Violating Yak Guru
469 Posts |
Posted - 2010-04-26 : 11:29:23
|
| It worked:declare @t table (c1 int, c2 datetime)insert into @t values(1, null)insert into @t values(2, getdate())select * from @t where c2 is nullI noticed there was something in the select that prevented me from getting the results.Thank you guys. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|