Home » RDBMS Server » Server Administration » date problem
date problem [message #372254] Mon, 22 January 2001 20:55 Go to next message
jeya
Messages: 18
Registered: January 2001
Junior Member
i have a query like below,

select processed_yrmth, sysdate,
to_char(:ld_start_date, 'YYYYMM')+ ph_reversal_mths
into :li_proc_yrmth, :ld_entry_date, :ls_ph_yrmth
from allow_para_mst_s;

when i update this :ls_ph_yrmth into the database then i got my yearmonth like '200013','200015'. i need like if month exceed 12 then it should come like 200101, 200103.
In this place how can i use add_months?. In my table ph_reversal_mths is number format. then onemore thing this should store in database like 'YYYYMM'. THAT IS '200101'.

Thanks in advance.

jeya.m
Re: date problem [message #372255 is a reply to message #372254] Mon, 22 January 2001 21:55 Go to previous message
Mahesh
Messages: 90
Registered: January 2001
Member
Hi
Try this
select processed_yrmth,
sysdate,
to_char(add_months(:ld_start_date,ph_reversal_mths), 'YYYYMM')
into :li_proc_yrmth, :ld_entry_date, :ls_ph_yrmth
from allow_para_mst_s;
Previous Topic: Tough SQL*Plus question
Next Topic: how to insert lots of data into a table!
Goto Forum:
  


Current Time: Mon Dec 23 01:07:00 CST 2024