|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
System Date minus three years?
Would anyone be able to help, please?I have a table called PS_N_ACTIVE (ORACLE DB) and I wanted to subtract three years from N_ACT_DUTY_SVC_DT. The date format is MM-DD-YYYY. I can't find the correct SQL statement to insert. Basically, I'm using several joins and top of stack logic but I wanted to be able to insert a statement something to the effect: ...."where ACT.N_ACT_DUTY_SVC_DT = SYSDATE MINUS 3 YEARS" and be able to have the output or results in the MM-DD-YYYY format.
I picked up a reference book The practical SQL Handbook but couldn't find any reference to what I wanted to do. Appreciate any help. Thank you. |
|
#2
|
||||
|
||||
|
Moved to appropriate forum.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
how about using add_months
ie. PHP Code:
|
|
#4
|
|||
|
|||
|
In Oracle 9i the following will do it:
select sysdate - to_yminterval('03-00') from dual Cheers, Dan |
|
#5
|
|||
|
|||
|
Thank you. I appreciate your help.
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > System Date minus three years? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|