Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Jet,
Remote views use ODBC connection to the database. ODBC has no concept of a blank date and 12/30/1899 (for VFP table, 1/1/1900 for SQL Server) is the default date that is stored when a blank date is updated via ODBC. You can either set the table up to accept nulls in date fields when a blank date is expected, or have code that interprets 12/30/1899 (and/or other defaults) as a blank date.
In my applications, when a date field is expected to possibly contain blank values, I store the dates in a character field in the format YYYYMMDD. This allows blank dates, allows querying for a range of dates and allows sorting by date order. It does however require conversion to a date format when outputing to reports and conversion from date to YYYYMMDD when querying or storing the date in the table. But it works with VFP, SQL and Oracle without having to deal with nulls or the different blank date defaults from each database.
HTH
Elmer
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement