Subject Re: [firebird-support] Re: Date, Time, TimeStamp Format/Separator ...
Author Martijn Tonies
Hi,

> > > how can i get the active date, time, timestamp format and
> > > separator with sql ?
> > >
> > > i.e. dd/mm/yyyy or mm/dd/yyyy with separator '/'
> > > or mm.dd.yyyy with separator '.' etc
> >
> > SELECT CURRENT_TIMESTAMP, CURRENT_TIME,
> > CURRENT_DATE
> >
> > FROM RDB$DATABASE
> >
> > The separator is a client side display thingy.
>
> Maybe i wasn't clear enough :)
>
> I want to construct a sql query through code ( Delphi ). But
> because the client's are in varius locales (Greek, English,
> Bulgarian, Romanian ) different from the server locale i need a
> universal way of constructing the date field or the time field or
> the timestamp. Else i get an error message ... You
> know '...transliterate blablabla ...'.

Ah, ok :-) ...

Well, there are several ways to do this - probably the easiest
is to use parameters for your date/time/datetime values:

WHERE ... = :MyDateTimeParam

This way, you don't have to bother about locales.

Alternatively, use the English style:

WHERE ... = 'mm/dd/yyyy'

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com