Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CAST with Blank Datetime Fields
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01028674
Message ID:
01028677
Views:
67
>I replaced TTOD with VFP9's new CAST function in much of my code (not just SQL Selects), but now find it doesn't seem to convert blank datetime fields in VFP tables. For example, in a real estate application table, I have a datetime field named "settlement". TTOD(SETTLEMENT) always yields a date variable regardless of whether the field contains data, but CAST(SETTLEMENT AS DATE) yields a datetime value if "settlement" is blank. This causes problems with comparison tests and measurement of intervals between dates. A known bug, perhaps, or have I erred?

No you didn't erred
dtTest =  CAST({} As DATETIME)
? dtTest
? CAST(dtTest as DATE) &&-> "  .  .      :  :  "
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform