pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Bertheau <twanger@bluetwanger.de>
To: azah azah <izza76@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Please help me.. problem in to_char
Date: Wed, 21 Jul 2004 14:15:57 +0200
Message-ID: <1090412156.3239.19.camel@dicaprio.akademie1.de> (raw)
In-Reply-To: <235b1a2804072101335eda05fd@mail.gmail.com>
References: <235b1a2804072101335eda05fd@mail.gmail.com>

В Срд, 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@bluetwanger.de>




view thread (5+ messages)  latest in thread

Message-ID: <1090412156.3239.19.camel@dicaprio.akademie1.de>
Permalink:  ../1090412156.3239.19.camel@dicaprio.akademie1.de/
Also on:    postgresql.org/message-id/1090412156.3239.19.camel@dicaprio.akademie1.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: twanger@bluetwanger.de, izza76@gmail.com
  Subject: Re: Please help me.. problem in to_char
  In-Reply-To: <1090412156.3239.19.camel@dicaprio.akademie1.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox