Yup, even better. For some reason I gave up trying to_date( '02', 'MON'
), which clearly wasn't working.
Thanks for the improvement!
Thomas F. O'Connell
Co-Founder, Information Architect
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
On Oct 19, 2004, at 6:00 PM, Edmund Bacon wrote:
> Thomas F.O'Connell wrote:
>> There might be a better way, but this should do what you want. And I
>> think that you can safely replace '05' with when_month.
>> select to_char( to_date( '05' || '/' || to_char( current_date,
>> 'DD/YYYY' ), 'MM/DD/YYYY' ), 'MON' );
> select to_char(to_date('02', 'MM'), 'MON');
> is better. When current_date is, say Aug 31 then
> select to_char( to_date('05' || '/' || to_char(current_date,
> 'MM/DD/YYYY' ), 'MON' );
> returns 'MAR', which is probably not what you want.
> This works with 7.3.2, 7.4.5 and 8.0beta2.
In response to
pgsql-sql by date
|Next:||From: Muhyiddin A.M Hayat||Date: 2004-10-20 04:43:00|
|Subject: Cross tabulations|
|Previous:||From: Postgres User||Date: 2004-10-20 02:41:11|
|Subject: Which type of functions are best?|