How Can I set a non standard date format?

From: clark(at)knowideas(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: How Can I set a non standard date format?
Date: 2007-03-02 19:20:28
Message-ID: 1172863228.112482.170670@8g2000cwh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All Esteemed Developers,

I have a requirement to have dates like ddmmmyyy. ie: 03MAR07

I want to be able to have dates returned from a query in this format
so that I can use passthrough queries from Access. I know I can use
to_char to format the date anyway I want, but this causes the column
to appear as a text datatype instead of a date datatype.

I am exporting the data to Excel, and the columns that have dates
formatted as text do not sort properly. That is why I want the column
to remain a date type.

In Oracle I could use NLS_TIMESTAMP_FORMAT to accomplish this. But I
cannot find a way to use PGDATESTYLE or anything else to to the same
thing.

Any ideas?

best regards,
billc

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Rich 2007-03-02 19:53:28 Custom session variables?
Previous Message Tom Lane 2007-03-02 19:10:30 Re: Re : Re : pg_dump, serial