On Thu, 2002-10-17 at 22:31, Tan ga wrote:
> Hi I'm using extract(dow from table.field) and i would like to transform the
> result into it's corresponding day.Ex:0 into Sunday
>
> How can i do this?
You could look it up in a table, or you could hard-code it something
like this:
CASE extract(dow from table.field) WHEN 0 THEN 'Sunday' ELSE WHEN 1 THEN
'Monday' ELSE WHEN 2 THEN 'Tuesday'
...
But the simplest way is probably to do something like:
to_char( table.field, 'FMDay' )
:-)
Cheers,
Andrew.
> --
> Crie o seu email gratuito no mail.pt
> http://www.mail.pt
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
--
---------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Survey for free with http://survey.net.nz/
---------------------------------------------------------------------