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 8653021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:26:33+00:00 2026-06-12T14:26:33+00:00

I have searched a bit for getting last 1hr details with 10mins interval, as

  • 0

I have searched a bit for getting last 1hr details with 10mins interval, as follow

if suppose the current time is 10:30, i am expecting the output as follows , kindly suggest me the solutions.

  TIME_SLOT

09:31 - 09:40
09:41 - 09:50
09:51 - 10:00
10:01 - 10:10
10:11 - 10:20
10:21 - 10:30

I have the table in the format (CUSTOMER) (FIG 1.1)

M_CODE  H_CODE END_TIME_OF_SERVICE ADULT ADULT_F
TKLK    LONE     09:19:16           1     2
TKLK    LONE     09:22:11           4     6
TKLK    LONE     09:32:46           2     7
TKLK    LONE     09:32:46           4     9
TKLK    LONE     10:09:36           1     3

and if i run the ( SELECT strftime(‘%H:%M’, end, ‘-9 minutes’) || ‘ – ‘ || strftime(‘%H:%M’, end ) AS time_slot FROM end_times ) it gives the correct output as (FIG – 1.2)

09:19 - 09:28
09:29 - 09:38
09:39 - 09:48
09:49 - 09:58
09:59 - 10:08
10:09 - 10:18 

Can you guide how to map these two tables, let`s say the the records in CUSTOMER table should be summed up for adult and adult_f column with( FIG 1.2 to FIG 1.1 )

   ADULT    ADULT_F    TIME_SLOT
      5        8      09:19 - 09:28
      6       16      09:29 - 09:38
      0        0      09:39 - 09:48
      0        0      09:49 - 09:58
      0        0      09:59 - 10:08
      1        3      10:09 - 10:18 

Kindly guide me a solution, thanks for your time.

  • 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-06-12T14:26:34+00:00Added an answer on June 12, 2026 at 2:26 pm

    SQL queries are designed to handle data that is stored in tables.
    If you want to create these dates, it might be easiest to just insert these values into a temporary table.

    Alternatively, you could construct the values, one by one. First define the offsets from the current time:

    CREATE VIEW intervals AS
    SELECT -50 AS offset UNION ALL
    SELECT -40           UNION ALL
    SELECT -30           UNION ALL
    SELECT -20           UNION ALL
    SELECT -10           UNION ALL
    SELECT   0
    

    Then you can construct the time slot end points like this:

    CREATE VIEW end_times AS
    SELECT datetime('now', offset || ' minutes') AS end
    FROM intervals
    

    Then format the time slots like this:

    SELECT strftime('%H:%M', end, '-10 minutes') || ' - ' ||
           strftime('%H:%M', end               ) AS time_slot
    FROM end_times
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched google and exhausted a fair bit of my time trying to
I have searched a bit on google, but didn't really found an answer to
I have searched a bit around for a pager for fragment , I develop
I have searched around a bit, and have not really found a professional type
I have searched this topic on google a bit and seen some best practices.
I have searched a bit upon it but can't get it to work properly.
I have searched quite a bit on the web and on this site and
I have searched a bit but all the answers on the exception is related
I have searched for this online, but am still a bit confused (as I'm
getting a bit confused over this problem... I have an administrative part of my

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.