Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Convert

Re: Convert

From: Vladimir M. Zakharychev <vladimir.zakharychev_at_gmail.com>
Date: Tue, 20 Nov 2007 04:48:59 -0800 (PST)
Message-ID: <ac4392f9-d665-4061-8a99-967915cb93c3@c29g2000hsa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US