Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Nilson Rishi
  Where is Nilson Rishi?
 Bangkok
 Thailand
 Nilson Rishi
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: test if a datetime field is empty on SQL
Thread ID: 248690 Message ID: 248765 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Wednesday, December 23, 2009 5:00:39 AM         
   


Borislav,

> Blanks - NO
> Empty - Yes.
> Sorry, my mistake
> Datetime fields are the only with NO EMPTY. Just becuase SQL Server keeps them as offset from 01/01/1900. So if you store zero in that fields you will get 01 Jan 1900 in your select.

Thank you for this info. Is this true with Date,datetimeoffset(7),smalldatetime data types, too?
I use SQL Server 2008.
BTW, both
UPDATE myTBL SET myDateTime=0 
AND
UPDATE myTBL SET myDateTime=space(0) 
works with a Datetime field and a Smalldatetime field.
However, for datetimeoffset(7) and Date field, only
UPDATE myTBL SET myField=space(0) 
works,
UPDATE myTBL SET myField=0 
cannot.
Regards,
Nilson

ENTIRE THREAD

test if a datetime field is empty on SQL Posted by Nilson Rishi @ 12/22/2009 10:45:58 AM
RE: test if a datetime field is empty on SQL Posted by Borislav Borissov @ 12/22/2009 11:11:55 AM
RE: test if a datetime field is empty on SQL Posted by Nilson Rishi @ 12/22/2009 12:46:52 PM
RE: test if a datetime field is empty on SQL Posted by Borislav Borissov @ 12/22/2009 2:29:32 PM
RE: test if a datetime field is empty on SQL Posted by Nilson Rishi @ 12/23/2009 5:00:37 AM
RE: test if a datetime field is empty on SQL Posted by Nilson Rishi @ 12/23/2009 5:00:39 AM
RE: test if a datetime field is empty on SQL Posted by Stefan Wuebbe @ 12/22/2009 11:16:38 AM
RE: test if a datetime field is empty on SQL Posted by Nilson Rishi @ 12/22/2009 12:48:31 PM
RE: test if a datetime field is empty on SQL Posted by Stefan Wuebbe @ 12/22/2009 4:11:41 PM