Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HT update remote sql table smalldatetime datatype?
Message
From
22/12/2003 19:12:34
 
 
To
22/12/2003 18:23:02
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00861453
Message ID:
00861464
Views:
20
>How do I update a remote sql table smalldatetime datatype through a VFP remote view? Right now it updates the columns with 1/1/1900.

This is in regards to empty dates, right? otherwise, as long as the view column's datatype is set to "T", it should be working ok...

There is no such thing as an 'empty' date in SQL Server. MSSQL stores the datetime values as a 8-byte format representing a number, so an 'empty' value is 0, which translates to 1/1/1900 when it is returned to the caller.

There's a couple of ways of handling 'empty' dates in SQL Server:
1) Allow nulls in the SQL Server column and handle the nulls in VFP and sql statements sent to the server. This is easy to handle in VFP, but null handling in SQL Server can get pretty complex, depending on the query.

2) Allow 1/1/1900 to be the default value [and 12/31/9999 to be the default values for top end dates of ranges] and handle the values in VFP. The SQL Server code gets easier, but the VFP side gets trickier, esp in regards to binding controls. [that alone makes me opt for option 1 <s>]
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform