Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Values for Datetime fields in SQL Server
Message
From
26/09/2002 15:57:55
 
 
To
26/09/2002 15:27:54
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00704918
Message ID:
00704942
Views:
13
SQL Server will not allow a blank date. The only way you can store a non existent date is to store a null value if a date hasn't been assigned.

Here's a little piece from SQL Server BOL

****
Microsoft® SQL Server™ has the datetime and smalldatetime data types to store date and time data.

There are no separate time and date data types for storing only times or only dates. If only a time is specified when setting a datetime or smalldatetime value, the date defaults to January 1, 1900. If only a date is specified, the time defaults to 12:00AM (Midnight).
***


John


>I am trying to set default values to blank dates in SQL Server.
>
>In VFP you can set a new date to {}. But in SQL Server, how do you do it? When I set a datetime field to (' '), I get 01/01/1900.
>
>Thanks.
>
>Bob Bartel
Previous
Reply
Map
View

Click here to load this message in the networking platform