Re: [GENERAL] Sort by foreign date column

2001-08-21 Thread Mike Mascari
"Andrey Y. Mosienko" wrote: > > Stephan Szabo wrote: > > > > On Tue, 21 Aug 2001, Andrey Y. Mosienko wrote: > > > > > > > > I have table with date type column: > > > > > > chdate date; > > > > > > SELECT chdate from mytable; > > > > > >chdate > > > 1999-01-02 > > > > > > But in Russia we hav

Re: [GENERAL] Sort by foreign date column

2001-08-21 Thread omid omoomi
and how about this: SELECT TO_CHAR(chdate, 'DD-MM-') FROM mytable ORDER BY chdate::date; >From: Mike Mascari <[EMAIL PROTECTED]> >To: "Andrey Y. Mosienko" <[EMAIL PROTECTED]> >CC: Stephan Szabo <[EMAIL PROTECTED]>, Postgres ><[EMAI

Re: [GENERAL] Sort by foreign date column

2001-08-21 Thread Mike Mascari
omid omoomi wrote: > > and how about this: > > SELECT TO_CHAR(chdate, 'DD-MM-') > FROM mytable > ORDER BY chdate::date; Yes, but Andrey says that the chdate field is declared as a date: > > > > On Tue, 21 Aug 2001, Andrey Y. Mosienko wrote: > > > > > > > > > > > > > > I have table with dat

Re: [GENERAL] Sort by foreign date column

2001-08-21 Thread Andrey Y. Mosienko
Tom Lane wrote: > > > On Tue, 21 Aug 2001, Andrey Y. Mosienko wrote: > > But in Russia we have the next date format: DD-MM-. > > Just setting DateStyle to 'SQL' would get you approximately what you > want: > > regression=# set DateStyle TO SQL; > SET VARIABLE > regression=# select now(); >

Re: [GENERAL] Sort by foreign date column

2001-08-21 Thread Tom Lane
"Andrey Y. Mosienko" <[EMAIL PROTECTED]> writes: >> If DD/MM/ is not close enough for you, maybe the right answer is to >> add another DateStyle. > Sorry for disturbing, but how can I do this or where is it in documentation? It's not documented; you'd have to dig into the code and see how th