?
Solved

oracle query

Posted on 2014-01-06
3
Medium Priority
?
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 500 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 74

Assisted Solution

by:sdstuber
sdstuber earned 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
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.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

770 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