Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Date Format in SQL
Mon, Sep 7 2009 2:13 AMPermanent Link

"Larry Coe"
Trying to delete some records from a table based on a tranzaction date, but
keep getting an error re date format.

My SQL using DBSYS.exe

Delete from Mytable
where txdate= "03/09/2009"

what is the correct format to use ? dd/mm/yyyy

Mon, Sep 7 2009 2:23 AMPermanent Link

Richard Harding
>> Delete from Mytable
where txdate= "03/09/2009"

what is the correct format to use ? dd/mm/yyyy

Larry,

 DELETE FROM MyTable
    WHERE txdate = DATE '2009-09-03'

will work.

Look up Date and Time Types in the SQL Manual which explains date literals.

Richard Harding
Mon, Sep 7 2009 4:38 AMPermanent Link

Uli Becker
Larry,

> My SQL using DBSYS.exe

Are you using DBISAM or EDB? (DBSys is a manager for DBISAM).

DBISAM:

DELETE FROM MyTable
     WHERE txdate = "2009-09-03"

EDB like Richard described:

DELETE FROM MyTable
     WHERE txdate = DATE '2009-09-03'


Uli
Image