Link to home
Start Free TrialLog in
Avatar of nicoleheritage
nicoleheritage

asked on

Subtracting 1 month from a given date

i have a date in mm/dd/yyyy format.
the date is always the end of the month.
for example 7/31/2007
i need to figure out what was the date at the end of the previous month ( i.e 06/30 2008). in mm/dd/yyyy format

what is the oracl sql for this ?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
note: you should better use the 1st of the month, and use yourfield < 1st_of_month.
also, you should have the date in DATE date type, and not in VARCHAR2 data type...