PRB: DTOC() Output Erroneous If Invalid Date Is UsedLast reviewed: June 27, 1995Article ID: Q96347 |
The information in this article applies to:
SYMPTOMSThe DTOC() function does not report on the validity of the date being processed. An incorrect entry of a date being used for comparison can result in unexplainable, erroneous results.
CAUSEThe DTOC() function processes date type information into a character string. An invalid date results in a blank date without any warning; for example:
STORE DTOC({06/30/92}) TO badate. ? badate && Note '06/30/92' will be displayed STORE DTOC({06/31/92}) TO badate ? badate && Note ' / / ' will be displayedAlthough this example illustrates that FoxPro knows June does not have 31 days, FoxPro returns blanks instead of giving a warning message. This can cause unexpected results in selecting records when DTOC() results are being used for comparison.
RESOLUTIONWhenever a report, query, or other output results in ALL records being output and a DTOC() function was being used for comparison, check the validity of the date in the DTOC() function by also checking for blank dates.
|
Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a every day month
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |