July 28th, 2004, 10:37 AM
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.
July 29th, 2004, 09:06 AM
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')
Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
July 29th, 2004, 01:09 PM
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.