how to use date function in my procedure
hi Gurus,
i have a requirement
where user passes the end_date parametre from front end which get convered to
End Date => 2012/05/31 00:00:00
now i based on this end date value i have to calculate the start date which is only month less than the end date, i know i can use add_months function for this requirement but
my problem is
l_start_date :=add_months(fnd_date.canonical_to_date(p_end_date),-1);
(OR)
l_start_date := add_months(to_date(end_date,'DD-MON-YYYY'),-1);
all these are returning date format as DD-MON-YYYY eg;
if user passes from front end 31-may-2012 , in the backend to my procedure it is passing as 2012/05/31 00:00:00
and my procedure calculating start date and returning as '01-MAY-12',
but my requiremnt is
it should return
Start Date => 2012/05/01 00:00:00
any pointers on this is highly appreciable,
thanks in advancee