Solved

oracle query

Posted on 2014-01-06
3
265 Views
Last Modified: 2014-01-06
I want to capture all expired frozen platelets products after 47 hours and 45 minutes from expiry_date

ie process_dats <= expiry_date + 47 hours and 45 mins.

Help appreciated.
script.txt
0
Comment
Question by:anumoses
3 Comments
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 125 total points
ID: 39759206
Try this:

select [whatever you need]
from [your_table]
where process_dats <= (expiry_date + 1 + 95/96)

or:
where process_dats <= (expiry_date + 191/96)

But, if you need to find expired records, and if they expire after two days (48 hours), then you may need to use ">=" (greater than or equla instaed of less than or equal) like this:

where process_dats >= (expiry_date + 1 + 95/96)

Date arithmetic explanation:  you  can add fractional portions of a day when you need Oracle to calculate or derive a date value.  For example, if you need to find all records that are almost one day (23 hours) old, you can do this:

where [date_column] >= sysdate + 23/24

In your case, where you need quarter-hour intervals, multiple the number of hours in a day by 4 (24 x4 = 96) to get the denominator to work with.
0
 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 125 total points
ID: 39759401
you can also use interval math with explicit units

process_dats <= expiry_date + (interval '47' hour) + (interval '45' minute)
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 39759449
thanks a lot
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now