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 SQL

Status
Not open for further replies.

deepatpaul

Programmer
Jul 7, 2004
57
US
I have to create a query that compares dates. For example, (date1 (plus n months)) has to be greater than date2, where n is an integer. How can I do this in ColdFusion? Some variation of the to_date(var) function, or something more involved?
 
How about:
Code:
SELECT ... from ...
WHERE add_months(date1,3) > date2;
...where "3" is the number of months beyond date1?

This should work in both SQL*Plus and Cold Fusion. Let us know.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA @ 16:45 (10Aug04) UTC (aka "GMT" and "Zulu"), 09:45 (10Aug04) Mountain Time)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top