Thread: date manipultation issue reg
- 03-01-2010 08:10 AM #1
date manipultation issue reg Dear all,
i have one table
Code sql:sql>desc request
Name NULL? Type
---------------------- --------- -----------------
reqid NOT NULL NUMBER(10)
requestname Varchar2(20)
STATUS varchar2(10)
lastmoddate date
i need to retreive lastmoddate record based on some condition given below,also i have written query for each requirement,but date manipulation logic is correct or not i am not sure,kindly help me out to modify the logic if it is not correct.
Requirement one: search requests that have been assigned but in pending state for more than 24hrs
Code sql:sql> SELECT reqid,requestname FROM request WHERE lastmoddate<sysdate - 1 AND STATUS='pending';
Requirement two: search requests that have been assigned but in escalated state for past 8 hrs
Code sql:sql> SELECT reqid,requestname FROM request WHERE lastmoddate<sysdate - 8/24 AND STATUS='escalated';
Requirement two: search requests that have been assigned but in closed state for two weeks
Code sql:sql> SELECT reqid,requestname FROM request WHERE lastmoddate>sysdate - 14 AND STATUS='closed';
Thanks n regards
Laxman
- Club-Oracle Complementary E-Books and Magazines
Get your free Complementary Copy of Oracle Magazine
You can also browse the Free Magazines and E-Books section to see the complete list of free magazines, e-books and Whitepapers.
- 03-03-2010 05:04 AM #2
Re: date manipultation issue reg All Fine Except last one. For the last one it should be < sign.
Code sql:SELECT reqid,requestname FROM request WHERE lastmoddate<sysdate - 14 AND STATUS='closed';
Or you can use <= bases on your requirement.
Raj.
- 03-04-2010 03:02 AM #3
Re: date manipultation issue reg thanks a lot sir.
Regards
Laxman
Similar Threads
-
date manipultation reg
By laxman in forum SQL PL/SQLReplies: 3Last Post: 01-11-2010, 03:08 AM -
Problem in date comparison
By JLone in forum SQL PL/SQLReplies: 2Last Post: 09-25-2009, 12:39 PM -
Converting AUG-09 to date in Oracle-SQL
By Farshad Javadi in forum SQL PL/SQLReplies: 2Last Post: 08-13-2009, 10:05 PM -
date counting help
By tomukaz in forum SQL PL/SQLReplies: 3Last Post: 10-21-2008, 07:05 AM


LinkBack URL
About LinkBacks
Reply With Quote

