Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty dates being sent as 12/30/1899
Message
De
05/02/2001 11:22:12
 
 
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:
00472488
Vues:
54
Vlad

I found it! I was fooling around in the ODBC Connection screen and saw a NULL check box. I unchecked it and all the dates work perfectly. Maybe the NULL date was being sent back as -1 and the code was therefore interpreting it as 12/31/1899 - 1 = 12/30/1899.

I am now moving on to the ADO world and trying to do the first baby steps toward making a conection there. Wish me luck!

I am trying to make John Peterson's article work.

Thanks again so much for your help

Terry


>Hi!
>
>Well, I see ODBS goes not so far from SQL Server. It looks like ODBC too does not like dates less than mentioned date. Try to use latest ODBC drivers. I did not met any settings for ODBC drivers that handle format of date field.
>
>Anyway, you can use the solution used for SQL Servers. Use .NULL. value for empty date instead of native VFP empty date value.
>
>>Vlad
>>
>>I am confused or I am not communicating my question correctly. This is my remote view code:
>>
>>
>>SELECT * FROM fingpr Fingpr ;
>>   ORDER BY Fingpr.last, Fingpr.first ;
>>   WHERE BETWEEN(Fingpr.Last, ?gcStartLast, ?gcEndLast)
>>
>>I set up a VFP driver server using ODBC in my control panel.
>>
>>The 'fingpr' table is a VFP table. When it comes accross all the empty dates come over as 12/30/1899. I recreated the view as a local view and the dates come accross as normal blank dates.
>>
>>Are you saying that somehow VFP is using SQL Server for remote views, implying that the driver has SQL Server in it somehow.
>>
>>
>>Please help me with my lack of understanding if you can. I seem to be missing some very important logic about ODBC Remote Views. It has to be something simple in my thinking pattern.
>>
>>Thanks again for your valued help
>>
>>Terry
>>
>>
>>
>>>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
It is impossible to make programs idiot proof. Idiots are too cleaver.

MCP( Tcp/Ip )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform