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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to remove data from a datetime field

Author  Topic 

sven2
Yak Posting Veteran

57 Posts

Posted - 2009-06-29 : 13:14:09
Hello,

when I remove a date in a datetimefield the result is always like
0:00:00. How can I make it so that the field is empty.

The code I use is like:

Update birthdate set date = ''

Thanks in advance,
Sven.

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2009-06-29 : 13:22:25
quote:
Originally posted by sven2

Hello,

when I remove a date in a datetimefield the result is always like
0:00:00. How can I make it so that the field is empty.

The code I use is like:

Update birthdate set date = ''NULL
Thanks in advance,
Sven.

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-30 : 04:24:31
Giving empty string will result to some other value
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/09/02/empty-string-and-default-values.aspx


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -