Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Blank out empty dates
Message
From
14/11/2006 14:08:39
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01169592
Message ID:
01169599
Views:
12
Thanks Sergey,

figured as much. I guess I'll see what I can do on the VFP cursor after it is returned from SQL Server as a temporary workaround.

>>Hi,
>>
>>I've got a VFP application querying a SQL Server 2005 database.
>>
>>Some date fields on the server are 'blank' (i.e. 1900-01-01 00:00:00.000)
>>
>>How can I query the data but pull out a truly blank value?
>>
>>I would guess something like this:
>>
>>SELECT cast(case when edc_ddepart = '1900-01-01 00:00:00.000' then '' else edc_ddepart end as [datetime]) as edc_ddepart
>>
>>But that isn't doing what I expect. Or is it that what I am trying to do is wrong and I should be using NULL values for blank dates?
>
>The SQL Server doesn't support empty dates. The CAST('' AS datetime) will return 1900-01-01 00:00:00.000. The NULLs is a proper way to represent blank/unknown dates in SQL Server.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform