pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Rowell <richard@rowell.info>
To: pgsql-sql@postgresql.org
Subject: to_date confusion
Date: 06 Jan 2003 21:58:35 -0600
Message-ID: <1041911915.2836.1.camel@workstation> (raw)

I'm confused.  How do I get the integer 10102 to come in as the date
2002-01-01?

cmi=> select to_date('010102','MMDDYY');
  to_date   
------------
 2002-01-01
(1 row)

cmi=> select to_char(10102,'000000');
 to_char 
---------
  010102
(1 row)

cmi=> select to_date(to_char(10102,'000000'),'MMDDYY');
  to_date   
------------
 2010-01-10
(1 row)

TIA!




view thread (5+ messages)  latest in thread

Message-ID: <1041911915.2836.1.camel@workstation>
Permalink:  ../1041911915.2836.1.camel@workstation/
Also on:    postgresql.org/message-id/1041911915.2836.1.camel@workstation

 · 

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: richard@rowell.info
  Subject: Re: to_date confusion
  In-Reply-To: <1041911915.2836.1.camel@workstation>

* 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