Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6226415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:01:37+00:00 2026-05-24T09:01:37+00:00

We have a configuration table as shown below that stores the start time and

  • 0

We have a configuration table as shown below that stores the start time and the duration.
If the start time is 9:20 pm (3rd one ) add the duration then the time becomes 9:35.
I have to find out if the current time is in between any of the values.
I have to return the output based on the start_time and duration. i.e current time should be between start_time and the start_time + duration. (between 09:20 and and 09:35)
Can you please help me with the sql query or is it better if we go with sql function?

Start_time, duration(minutes)   output

1108                 5            2

1054                100           5

2120                15            8
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:01:38+00:00Added an answer on May 24, 2026 at 9:01 am

    I’m not a fan of storing dates and times in VARCHAR2 columns. START_TIME should really be a DATE or a TIMESTAMP column.

    That said, you can do something like

     with x as (
       select '1108' start_time, 5 duration, 2 output from dual
       union all
       select '1054', 100, 5 from dual
       union all
       select '2120', 15, 8 from dual
     )
     select *
       from (
         select to_date(
                   to_char(sysdate,'YYYY-MM-DD') || ' ' ||
                     start_time,
                   'YYYY-MM-DD HH24MI' ) start_date,
                to_date(
                   to_char(sysdate,'YYYY-MM-DD') || ' ' ||
                     start_time,
                   'YYYY-MM-DD HH24MI' ) + duration/24/60 end_date
       from x)
      where sysdate between start_date and end_date
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that appends some rows to a table. One of the
I have some configuration data that I'd like to model in code as so:
I have a project where there are multiple applications that have some common configuration
I have an SSIS package that loads data in a table. How do I
I want to execute stored procedure with one parameter that returns table using EF4
I am facing problem with hibernate annotations.For the code shown below I have a
I have some configuration values for an asp.net web app. They will be maintained
I am working on a small AIR desktop application and I have some configuration
In a .NET project, say you have a configuration setting - like a connection
I have an XML configuration file with a collection of strings like so: <SomeSetting>value</SomeSetting>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.