Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Convert
On Nov 20, 3:31 pm, pal <jayadevpal..._at_gmail.com> wrote:
> SELECT CONVERT(Char(4), location.next_pay_date, 102)
> INTO :is_year
> FROM location
> WHERE location.loc_cd = '01' ;
>
> This code works properly with SQLServer,
>
> how to do the convert(Char,location.next_pay_date, 102) in oracle..
>
> can any one help me out.
See TO_CHAR(date) function in Oracle SQL Reference. Your particular example would look like this:
SELECT TO_CHAR(location.next_pay_date,'YYYY')
INTO :is_year
FROM location
WHERE location.loc_id = '01';
Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com
Received on Tue Nov 20 2007 - 06:48:59 CST