Re: Please help me.. problem in to_char

From: Markus Bertheau <twanger(at)bluetwanger(dot)de>
To: azah azah <izza76(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Please help me.. problem in to_char
Date: 2004-07-21 12:15:57
Message-ID: 1090412156.3239.19.camel@dicaprio.akademie1.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

В Срд, 21.07.2004, в 10:33, azah azah пишет:
> Hi,
> I want convert from mysql to postresql, previously
> in mysql the code as below:
>
> SELECT t2.id, t2.name, date_format(t1.created,\'%W %M %e, %Y - %r\')
>
> In postresql no date_format function, we need to use to_char function
> but it still work because still need to put ::date such as
> SELECT to_char('2005-03-27'::date,'DD/MM/YYYY');
>
> How can i put ::date beside t1.created to get the output?

Just do it:

to_char(t1.created::date, 'DD/MM/YYYY')

--
Markus Bertheau <twanger(at)bluetwanger(dot)de>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Theodore Petrosky 2004-07-21 12:35:06 Re: Please help me.. problem in to_char
Previous Message sad 2004-07-21 11:42:13 ? on announcement of 7.5