Skip site navigation (1) Skip section navigation (2)

Re: help with to_date and to_char

From: Edmund Bacon <ebacon(at)onesystem(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: help with to_date and to_char
Date: 2004-10-19 23:05:08
Message-ID: 41759DA4.6070803@onesystem.com (view raw or flat)
Thread:
Lists: pgsql-sql
Edmund Bacon wrote:
>  When current_date is, say Aug 31 then
> 
> select to_char( to_date('05' || '/' || to_char(current_date, 'DD/YYYY'),
>                 'MM/DD/YYYY' ), 'MON' );
>

NUTS! that should have been
   select ... to_date('02' || ...

{ cut, paste, ?edit? }

> returns 'MAR', which is probably not what you want.
> 
> This works with 7.3.2, 7.4.5 and 8.0beta2.
> 
-- 
Edmund Bacon <ebacon(at)onesystem(dot)com>

In response to

Responses

pgsql-sql by date

Next:From: loridDate: 2004-10-19 23:08:24
Subject: Re: help with to_date and to_char
Previous:From: Edmund BaconDate: 2004-10-19 23:00:08
Subject: Re: help with to_date and to_char

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group