Re: convert from an integer to a date

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: convert from an integer to a date
Date: 2003-02-17 21:43:01
Message-ID: 5.1.1.6.0.20030217164006.03b8dec0@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 04:33 PM 2/14/03, STashlitsky(at)JEFCO(dot)com wrote:
>When I run select to_date('20030212','YYYYMMDD') the output is 2/12/03
>if I run select to_date( to_char(20030212,99999999),'YYYYMMDD'); the
>output is 6/23/05
>
>How can I convert from integer into date format correctly?

Same as the first one, except leave out the quotes.
select to_date(20030212,'YYYYMMDD');

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Yudie 2003-02-18 00:21:28 Re: Format Function
Previous Message Tambet Matiisen 2003-02-17 21:22:24 Re: select from update from select?