Subject Re: [firebird-support] Fundamental of DATE type
Author Helen Borrie
At 11:06 AM 12/09/2003 +0700, you wrote:
>Hello,
>
>I have a problem here, I have inserted a lot of record into my table from
>many processes which is one of it's field is a DATE type. The problem is
>about the DD and MM formatting, I am inserting using this Syntax
>
>Insert Into TABLE (dtreceive, price, ID) values ('9/1/2003', 23000, 2);
>
>I mean convert the date data from a String '9/1'2003' to input in
>MM/DD/YYYY format, but a lo of the data is reversed in DD/MM/YYYY.

If you use the date literal format '9/1/2003' the date will be as 9-JAN-2003.
If you use '9.1.2003' the date will be as 1-SEP-2003. There is no
possibility that it works sometimes one way and sometimes another, as long
as the SQL receives the correct date literal.

However, if you are using Windows and have an application interface whose
date data you are converting, your own decoding algorithm can mess things
up if your windows locale settings provide a short date format of
dd/mm/yyyy. A person can go insane trying to hassle with the date
conversion functions provided in Delphi, for example.


>I want to know how's the most efficien way to input into the table so I
>will never worry about the format sequences again.

Like Alan suggests, stick with a literal format that doesn't risk this
confusion. 01-sep-2003 works well (case doesn't matter) or ISO formats
YYYYMMDD or YYYY-MM-DD.

heLen