Re: mapping date value (SQL question)

From: Jeff Self <jself(at)nngov(dot)com>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: "'Mancz, James'" <James(dot)Mancz(at)Aspect(dot)com>, "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: mapping date value (SQL question)
Date: 2002-02-21 14:38:35
Message-ID: 1014302316.15734.5.camel@personnel_test
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, 2002-02-21 at 09:31, Johnson, Shaunn wrote:
> --that's close. but i need the '0' in the field between the
> year and the quarter.
>
> --all of this because a company want's fixed length columns.
>
> --i was reading about something like this:
>
> [example]
>
> select to_char(to_date('05/21/1998'),'Q') from dual
>
> [/example]
>
> --trying to modify it somehow ...
>
> --thanks!
>
> -X

Are you talking about showing the quarter as 01 or 02 instead of 1 or 2?
If so, just convert the quarter to a character using casting I suppose
and insert the 0 in front of it. What are you using to provide the
reports? It would probably be a lot easier to let those tools do the
work for you. Perl or PHP could easily make the quarter look like 01 or
02.

--
Jeff Self
Information Technology Analyst
Department of Personnel
City of Newport News
2400 Washington Ave.
Newport News, VA 23607
757-926-6930

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Liam DeMasi 2002-02-21 15:13:18 Re: libpq++ problem
Previous Message Vivek Khera 2002-02-21 14:36:21 Re: [GENERAL] schema error upgrading from 7.1 to 7.2