Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty dates being sent as 12/30/1899
Message
 
 
À
29/01/2001 12:09:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00469301
Message ID:
00470323
Vues:
59
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform