Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

oracle query with substracting 60 minutes from time

Posted on 2014-01-29
2
Medium Priority
?
409 Views
Last Modified: 2014-01-29
select current_date,
       to_char(current_date,'HH24:MI') currenttime,
       schedule_start_time,
         to_char(schedule_start_time,'HH24:MI') starttime,
       schedule_end_time,
         to_char(schedule_end_time,'HH24:MI') endtime,
           case when to_char(current_date,'HH24:MI')
             between to_char(schedule_start_time,'HH24:MI') and to_char(schedule_end_time,'HH24:MI')
             then 'in between'
             else 'not in between'
           end between_times
  from drives@qdon d,sites s
 where d.location_id = s.lt_location_id
   and drive_id = 'DRV5543050'
   and drive_date = trunc(sysdate);


CURRENT_DATE,CURRENTTIME,SCHEDULE_START_TIME,STARTTIME,SCHEDULE_END_TIME,ENDTIME,BETWEEN_TIMES

1/29/2014 11:31:10 AM,11:31,1/29/2014 11:30:00 AM,11:30,1/29/2014 7:00:00 PM,19:00,in between

I want to substract 60 minutes from both

 schedule_start_time and to_char(schedule_start_time,'HH24:MI') starttime

Help is appreciated
0
Comment
Question by:anumoses
2 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1000 total points
ID: 39818395
many ways to subtract 1 hour.

Try:
date_column-(60/1440)
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 39818421
thanks that worked
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

916 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