Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC connection converts .NULL. date field into {31/12/1
Message
From
23/05/2002 13:57:31
 
 
To
23/05/2002 10:15:17
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00660427
Message ID:
00660642
Views:
8
Searching VFP help on 12/30/1899, it appears that VFP substitutes this date as a default date for a blank datetime expression when the date is blank. The concept of a blank date is allowed in a DBF, but not in many other databases.From help topic TTOD
tExpression

Specifies a date and time expression from which TTOD( ) returns a Date value. tExpression must evaluate to a valid DateTime. If tExpression contains only a time, Visual FoxPro adds the default date of 12/30/1899 to tExpression and returns this default date.
Evidently 12/30/1899 is considered to be the default date by the odbc driver when a blank date is encountered.
It is for this reason that I store dates in a character field in the format YYYYMMDD when blank dates are expected. This makes it sortable by date and also allows blank dates to be stored with any database backend. It requires conversion when displaying dates on reports however.

BTW, A blank datetime value entered into a datetime field in a remote view of a SQL Server table updates to be 01/01/1900 12:00:00 AM in the database.

Elmer
Previous
Reply
Map
View

Click here to load this message in the networking platform