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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:10:36+00:00 2026-06-05T15:10:36+00:00

Please look the following query: SELECT ID, START, END FROM TABLEA the result is:

  • 0

Please look the following query:

SELECT ID, START, END FROM TABLEA

the result is:

ID       START                      END
1        2012-06-07 19:32:00        2012-06-08 06:00:00
2        2012-06-08 06:00:00        NULL

But I want really a result like this:

START                      END
2012-06-07 19:32:00        2012-06-07 23:59:59
2012-06-08 00:00:00        NULL

The id no matters.

And look at this example:

 ID       START                      END
    1        2012-06-06 19:32:00        2012-06-08 06:00:00
    2        2012-06-08 06:00:00        NULL

It Must be:

        START                      END
        2012-06-06 19:32:00        2012-06-06 23:59:59
        2012-06-07 00:00:00        2012-06-07 23:59:59
        2012-06-08 00:00:00        NULL

The idea is to generate rows with the start and end values within the same day.

Thanks in advance.

  • 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-05T15:10:37+00:00Added an answer on June 5, 2026 at 3:10 pm
     with       cte
          AS ( SELECT   MIN(START) AS MinStart ,
                        MAX(START) AS MaxStart
               FROM     TableA
               UNION ALL
               SELECT   DATEADD(DAY, 1, MinStart) ,
                        MaxStart
               FROM     cte
               WHERE    DATEADD(DAY, 1, MinStart) BETWEEN MinStart AND MaxStart
             )
    SELECT  MinStart AS START ,
            DATEADD(millisecond, -3, FLOOR(CAST(MinStart AS FLOAT)) + 1) AS [End]
    FROM    cte
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please take a look at the following snippet: public IEnumerable<T> Query(Expression<Func<T, bool>> filter) {
i want to write NSString into NSMutableArray.Please look at the following code: NSData *returnData
Please look at the following jsFiddle and alter appropriately. I basically want the text
am new here. i have a slight problem; PLease look at the following code
Getting the above error in following code. How to rectify it. Thanks. Please look
Please take a look at the following .htaccess ErrorDocument 404 /404/ RewriteEngine On RewriteRule
In my current project, Workflows have comments. Please have a look at the following
Please look at this image here is 3 tables , and out i want
Please look at this code: @interface myObject:NSObject -(void)function:(id)param; @end @implementation myObject -(void)function:(id)param { NSLog(@BEFORE);
Consider the following Query : var profilelst = ( from i in dbContext.ProspectProfiles where

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.