Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

FoxPro ODBC Null Date Problem

Explorer ,
Aug 01, 2006 Aug 01, 2006
I have an old FoxPro database that I am working with and I am trying to look for NULL dates. When using DBFViewer they appear as " / / ". When passed through ODBC they come out as 1899/12/30. I have not been able to search for these blank dates successfully using the normal means (NULL- " / / " - CreateODBCDateTime('1899/12/30')). Any ideas? Thanks for your assistance.
TOPICS
Database access
3.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 02, 2006 Aug 02, 2006
Did you try the Fox NULL value (".null.") in your query? Or the Fox CTOD() function? These should work through the Fox driver.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2006 Aug 15, 2006
PhilH Thanks!

Searching for date = ctod("/ / ") works like a charm. Wasn't able to get (".null.") working, produced Operator/operand type mismatch error. Probably syntax error on my part. Could you demonstrate? Thanks a million, now I can get this stuff out of VFP!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 23, 2006 Aug 23, 2006
You can use the ODBC curly-bracket syntax to pass a date value to VFP. Or, as you've discovered, you can use many of the VFP functions because they're built into the driver.

Another neat trick is that you can write a VFP program, compile it, place in the system32 directory, and use it as a function in your queries. We have a fiendishly complex pricing algorithm that we packaged in this manner, and it works like a charm.

HTH,
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 30, 2006 Aug 30, 2006
LATEST
Thanks again! I got both of these to return the information I need:
date = { / / }
date = {".null."}

Thanks for the heads up on the VFP function!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources