#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    45
    Rep Power
    11

    Handling dates in Firebird


    I have created some tables for my database and have used a date field. Upon trying to perform an insert through the code, I get an error on the insert. I've narrowed it down to the date being the issue. When I checked the db for the format I noticed that FB uses the DDMMYYYY format.

    Now I'm using a datetimepicker control in my app and was using the usual syntax of #date# for the insert which is in MMDDYYYY format. So, my question is how do I insert a date into the FB table?? Appreciative.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    249
    Rep Power
    14
    format I noticed that FB uses the DDMMYYYY format
    No it doesn't - your client tool might display it that way because it uses your Windows formatting.

    Firebird itself, for insert/update, uses MM-DD-YYYY and several other formats.

    This works fine despite any OS date format settings:

    INSERT INTO mytable VALUES ('20-01-2004')
    Martijn Tonies
    Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
    Upscene Productions
    http://www.upscene.com
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    45
    Rep Power
    11
    Thanks I figured out that to insert dates I don't have to input the pound signs with the date value. I noticed Firebird treats the field basically as a text field so I just need apostrophes. Thanks upscene.

IMN logo majestic logo threadwatch logo seochat tools logo