Subject | IB_SQL and dates |
---|---|
Author | Norman Dunbar |
Post date | 2002-06-24T10:41:06Z |
Would I be correct in saying that when I use IB_SQL to do an insert (on the
DSQL or SCRIPT tabs) where some of the fields are datatype DATE, that I must
always insert in the USA format of mm/dd/yyyy as in :
insert into test_table (a_date_field) values (cast ('12/31/2002' as date));
or is there a way to do it in the client's chosen date format ?
In oracle (Sorry) I can do this :
insert into test_table (a_date_field) values
(to_date('31/12/2002','DD/MM/YYYY'));
which means that regardless of the users date format on the server, insert
this as a date in dd/mm/yyyy format. This doesn't affect the way the date is
stored, only the way the character string '31/12/2002' is interpreted and
validated.
I've looked in the docs, but can't find anything (which doesn't mean it
isn't there ...).
IBO_SQL compiled from the source in 4.2Hd.
WI-V6.2.794 Firebird 1.0
PC local settings English(UK) and date format is dd/mm/yyyy.
Thanks.
Regards
Norman.
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
This email is intended only for the use of the addressees named above and
may be confidential or legally privileged. If you are not an addressee you
must not read it and must not use any information contained in it, nor copy
it, nor inform any person other than Lynx Financial Systems or the
addressees of its existence or contents. If you have received this email
and are not a named addressee, please delete it and notify the Lynx
Financial Systems IT Department on 0113 2892990.
DSQL or SCRIPT tabs) where some of the fields are datatype DATE, that I must
always insert in the USA format of mm/dd/yyyy as in :
insert into test_table (a_date_field) values (cast ('12/31/2002' as date));
or is there a way to do it in the client's chosen date format ?
In oracle (Sorry) I can do this :
insert into test_table (a_date_field) values
(to_date('31/12/2002','DD/MM/YYYY'));
which means that regardless of the users date format on the server, insert
this as a date in dd/mm/yyyy format. This doesn't affect the way the date is
stored, only the way the character string '31/12/2002' is interpreted and
validated.
I've looked in the docs, but can't find anything (which doesn't mean it
isn't there ...).
IBO_SQL compiled from the source in 4.2Hd.
WI-V6.2.794 Firebird 1.0
PC local settings English(UK) and date format is dd/mm/yyyy.
Thanks.
Regards
Norman.
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman.Dunbar@...
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
This email is intended only for the use of the addressees named above and
may be confidential or legally privileged. If you are not an addressee you
must not read it and must not use any information contained in it, nor copy
it, nor inform any person other than Lynx Financial Systems or the
addressees of its existence or contents. If you have received this email
and are not a named addressee, please delete it and notify the Lynx
Financial Systems IT Department on 0113 2892990.