Pervasive
Sign in | Join | Help
in

Date problem in Delete statement

Last post 05-21-2008 9:54 AM by BtrieveBill. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-20-2008 2:44 PM

    • covey
    • Not Ranked
    • Joined on 01-16-2007
    • Posts 4

    Date problem in Delete statement

    I'm trying to get rid of duplicate production records in a inventory history table.  My problem is that there are inventory records with no date in the transdate field.  I  think that is why my delete statement won't work. Here is my code:

    delete from Inhist where LocationID = 'CS01' and TransDate = '2007-10-16' and ProductID = 'CM11A' and BatchID < '11221' and ShipOrReceive = 'P'; 

    I know this is correct data because I have pulled it up in Pervasive, however I cannot pull it up if I reference the transdate. 

     Thanks

    Cathy

     

  • 05-20-2008 6:40 PM In reply to

    Re: Date problem in Delete statement

     What error are you getting?

    Mirtheil
  • 05-21-2008 9:54 AM In reply to

    Re: Date problem in Delete statement

    You may also have a bad index definition in the DDF's.  Run the CheckDB Wizard or DDF Builder's Consistency Check to verify that the indices match the Btrieve keys for this file.

    You can also try replacing the date expression with "IS NULL" to see if you have null dates in the file.
     

    Bill Bach
    Goldstar Software Inc.
    www.goldstarsoftware.com
Page 1 of 1 (3 items)
© 2008 Pervasive Software Inc. All Rights Reserved.