Home » SQL & PL/SQL » SQL & PL/SQL » Add Date Function
Add Date Function [message #18820] Fri, 15 February 2002 10:48 Go to next message
jneill
Messages: 1
Registered: February 2002
Junior Member
Hello,

I've been trying to create a SQL query to add or subtract a number of days from an inputted date parameter. It works with SQL Server and the DATEADD function, but for Oracle, I haven't been successful. I know of the ADD_MONTHS function for Oracle, but I need to work with days.
Here is what I want to do:

SQL:
SELECT * FROM table WHERE (userimput - 7) > datecolumn

I don't think it is working because I am trying to subtract from a user-entered parameter, and not from a regular field in the table. Does anyone have any suggestions?
Thanks in advance
Re: Add Date Function [message #18821 is a reply to message #18820] Fri, 15 February 2002 11:02 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
SELECT * FROM table WHERE datecolumn < to_date(userinput,'mm/dd/yyyy') - 7
Previous Topic: Passing a parameter list for IN clause in cursor.
Next Topic: DEBUG ROUTINE
Goto Forum:
  


Current Time: Fri Apr 26 20:20:01 CDT 2024