Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date manipulation function

Status
Not open for further replies.

vadimg

IS-IT--Management
Oct 25, 2001
152
US
hi.
i have a string date: '19981231'
i need to get a date that's 1 year back from this date.

what function would i use to convert this string into datetime and then minus 1 year from it?

thanks!
 
ok, i actually decided not to be lazy and look up the syntax myself.

i have

add_months(to_date(char_field, 'yyyymmdd'),-12)

is there something specifically for years, or should i just use months?
 
I would use months - you code looks fine the way it is.

Elbert, CO
1359 MDT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top