X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7CCB2D1B181 for ; Wed, 21 Jul 2004 09:16:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96488-05 for ; Wed, 21 Jul 2004 12:16:33 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id 72558D1B252 for ; Wed, 21 Jul 2004 09:16:28 -0300 (ADT) Received: from [62.165.4.166] (dicaprio.akademie1.de [62.165.4.166]) (authenticated) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id i6LCG2f15259; Wed, 21 Jul 2004 14:16:02 +0200 Subject: Re: Please help me.. problem in to_char From: Markus Bertheau To: azah azah Cc: pgsql-sql@postgresql.org In-Reply-To: <235b1a2804072101335eda05fd@mail.gmail.com> References: <235b1a2804072101335eda05fd@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Message-Id: <1090412156.3239.19.camel@dicaprio.akademie1.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Wed, 21 Jul 2004 14:15:57 +0200 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/147 X-Sequence-Number: 18399 =D0=92 =D0=A1=D1=80=D0=B4, 21.07.2004, =D0=B2 10:33, azah azah =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > Hi,=20 > I want convert from mysql to postresql, previously > in mysql the code as below: >=20 > SELECT t2.id, t2.name, date_format(t1.created,\'%W %M %e, %Y - %r\')=20 >=20 > 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'); >=20 > How can i put ::date beside t1.created to get the output? Just do it: to_char(t1.created::date, 'DD/MM/YYYY') --=20 Markus Bertheau