Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty dates being sent as 12/30/1899
Message
From
30/01/2001 16:07:42
 
 
To
29/01/2001 12:09:14
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00469301
Message ID:
00470323
Views:
61
Hi!

When you use local view, data queried from VFP table. When remote view - data queried from SQl Server. In both cases data formats and format of SQL Select statement is hardly depended on what you use. One example are dates. In VFP database they could be empty, in SQL Server there are no database. View just displays data from VFP database or from SQL Server. It does nothing with data converting (but you can do this), and cannot do anything to prevent your problem. This should be solved on the level of the tool you use (SQL Server).

SELECT statement syntax is different for remote views, just because that query runs on the SQL Server, not in the VFP. Thus you should learn SQL syntax for SQL Server to work with it on the more advanced level. In particular, VFP function 'IIF' equivalent on the SQL Server is field-level CASE statement.

HTH.

>>Hi!
>>
>>SQL Server does not have empty date value, as well as no dates less than mentioned date.
>>To solve your problem, use .NULL. value in the field as empty date.
>>
>>>I am using a parameterized remote view from a VFP table. I used the MS VFP driver to set up the connection. When I initilize the parameters & do a requery on the view all the empty date fields come over as 12/30/1899. I tried to search the threads and only came up with one person who got 01/01/1899 from an SQL query and no listed solution.
>>>
>>>I am confused as to what to do to correct this. (and where did they get such a wack date from)
>>>
>>>Thanks in advance
>>>
>>>Terry
>Thanks for the reply Vlad
>
>I tried an experiment and made the view local. Guess what - the dates came over fine. Remade the remote view & 12/30/1899 again. VERY strange!!
>
>Does this mean that I can't use SQL SELECT * ... format and must make special IIF functions for each of my date fields? Not very elegant.
>
>Also, I got a reply from Bob Evans pointing to an Integer date system that would display -1 as 12/30/1899. Do you think the VFP ODBC driver does this?
>
>
>Thanks again for your help. Your comments are always of great use.
>
>Terry
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform