Date Query [message #280345] |
Tue, 13 November 2007 05:07 |
balaji23_d
Messages: 123 Registered: February 2007
|
Senior Member |
|
|
Hi all,
How to check the date(Sysdate) with less than 6 months(No need to mention the 6th month date)
|
|
|
Re: Date Query [message #280348 is a reply to message #280345] |
Tue, 13 November 2007 05:13 |
ThomasG
Messages: 3211 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Don't worry, on any reasonably fast machine a check of sysdate will take less than 6 months.
At least, that's how I understood your question.
|
|
|
Re: Date Query [message #280351 is a reply to message #280345] |
Tue, 13 November 2007 05:20 |
balaji23_d
Messages: 123 Registered: February 2007
|
Senior Member |
|
|
I need to check the list of customers who have not the paid the amount with less than 6 months...Pls send the query
This is what i did
select app.app_id,app.app_contract_dt from omf_api_applications app
where app.app_contract_dt < to_date('01/05/2007', 'dd/mm/yyyy')
Instead of '01/05/2007' what do we can using?... Because we dont know whats the 6 month date? Pls solve my problem
|
|
|
Re: Date Query [message #280353 is a reply to message #280351] |
Tue, 13 November 2007 05:28 |
ThomasG
Messages: 3211 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Is this what you are after?
select app.app_id,app.app_contract_dt from omf_api_applications app
where app.app_contract_dt < add_months(Trunc(SYSDATE,'MM'), -6)
|
|
|
|
Re: Date Query [message #280355 is a reply to message #280351] |
Tue, 13 November 2007 05:30 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
You can add and subtrace number from dates to give other dates:
sysdate+3 is 3 days in the future
sysdate-7 is this day last week
sysdate + (1/24) is one hour in the future
You can also use ADD_MONTHS to add calendar months onto a date:
|
|
|
|