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
Solved

oracle query with substracting 60 minutes from time

Posted on 2014-01-29
2
389 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 77

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle - Query link database loop 8 41
Creation date for a PDB 5 39
return value in based on value passed 6 28
pl/sql parameter is null sometimes 2 16
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…
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…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
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.

829 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