Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 28th, 2004, 09:37 AM
jccorner jccorner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 45 jccorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m
Reputation Power: 5
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.

Reply With Quote
  #2  
Old July 29th, 2004, 08:06 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 8
Quote:
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

Reply With Quote
  #3  
Old July 29th, 2004, 12:09 PM
jccorner jccorner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 45 jccorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m
Reputation Power: 5
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Handling dates in Firebird


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT