Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007

    Unanswered: Sql Problem With Dates

    Using VB6, I am opening a Pervasive table using ADO and a SQL query of the form "Select * from arlinh WHERE shipdate > '12/2/2006'". If I use any field other than a date field, I have no problems. However, with a date field, I get an error....
    [LBA][Pervasive][ODBC Engine Interface]Error in Predicate:shipdate > '12/2/2006'
    Why am I having problems with dates.

  2. #2
    Join Date
    Dec 2001
    Provided Answers: 6
    If the field in the Pervasive table is defined as a "Date", then you'll need to specify the date in the format: 'yyyy-mm-dd'. You will need to include it in single quotes. So your statement would be:
    Select * from arlinh WHERE shipdate > '2006-12-02'
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Feb 2007

    It worked beautifully

    Thanks! I tried a similar format, but yours was the one that worked. I eventually wound up with a WHERE phrase that read....
    "WHERE ((shipdate BETWEEN '12/3/2006' AND '1/6/2006') AND (revenueacctkey BETWEEN '4000000' AND '4999Z999'))"
    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts