Solved

oracle query with substracting 60 minutes from time

Posted on 2014-01-29
2
385 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 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
custome paging in C# & oracle using inline queries. 12 43
Oracle Database Upgrade 13 62
null value 15 93
Determine Who is Runnig my Bash Shell Script 4 61
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

912 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

27 Experts available now in Live!

Get 1:1 Help Now