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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:27:27+00:00 2026-06-06T16:27:27+00:00

here is my data: +—-+——————+——————–+ | ID | DateTime Entered | DateTime Completed |

  • 0

here is my data:

+----+------------------+--------------------+
| ID | DateTime Entered | DateTime Completed |
+----+------------------+--------------------+
|  1 | 6/17/2011 10:08  | 6/18/2011 14:39    |
|  2 | 5/10/2011 9:29   | 5/15/2011 17:29    |
|  3 | 3/2/2009 9:30    | 3/3/2009 13:40     |
|  4 | 3/3/2009 11:36   | 3/4/2009 16:39     |
|  5 | 3/3/2009 11:37   | 3/4/2009 16:39     |
|  6 | 3/3/2009 11:38   | 3/4/2009 16:39     |
|  7 | 3/3/2009 11:38   | 3/4/2009 16:38     |
|  8 | 3/3/2009 11:38   | 3/5/2009 9:08      |
|  9 | 1/10/2011 9:43   | 1/11/2011 13:13    |
| 10 | 2/11/2011 12:20  | 2/12/2011 15:01    |
| 11 | 8/14/2009 10:20  | 8/17/2009 15:56    |
| 12 | 11/19/2008 9:45  | 11/20/2008 14:56   |
| 13 | 2/10/2011 13:50  | 2/11/2011 19:36    |
| 14 | 8/14/2009 10:23  | 8/17/2009 15:56    |
| 15 | 8/17/2009 9:43   | 8/18/2009 13:56    |
| 16 | 8/17/2009 9:43   | 8/19/2009 6:47     |
| 17 | 8/14/2009 10:28  | 8/17/2009 15:56    |
| 18 | 12/17/2008 10:03 | 12/18/2008 11:07   |
| 19 | 1/13/2009 9:41   | 1/14/2009 18:11    |
| 20 | 1/20/2009 9:18   | 1/21/2009 15:08    |
| 21 | 2/12/2009 10:53  | 2/13/2009 15:21    |
| 22 | 1/20/2009 9:19   | 1/21/2009 15:08    |
| 23 | 1/13/2009 9:50   | 1/15/2009 8:45     |
| 24 | 1/13/2009 9:50   | 1/14/2009 14:40    |
| 25 | 1/13/2009 9:36   | 1/14/2009 18:11    |
| 26 | 12/17/2008 10:06 | 12/18/2008 11:06   |
| 27 | 12/17/2008 10:04 | 12/18/2008 11:06   |
| 28 | 3/30/2010 9:20   | 3/31/2010 13:44    |
| 29 | 1/25/2010 9:33   | 1/26/2010 14:20    |
| 30 | 1/30/2009 11:21  | 2/2/2009 14:44     |
| 31 | 6/17/2010 9:07   | 6/18/2010 14:17    |
| 32 | 6/16/2010 10:24  | 6/17/2010 16:20    |
| 33 | 6/14/2010 9:33   | 6/15/2010 8:52     |
| 34 | 5/27/2010 9:15   | 5/28/2010 14:15    |
| 35 | 5/27/2010 10:16  | 5/28/2010 15:51    |
| 36 | 5/21/2010 9:15   | 5/23/2010 13:05    |
| 37 | 5/19/2010 10:08  | 5/20/2010 13:33    |
| 38 | 6/30/2010 11:41  | 7/1/2010 18:16     |
+----+------------------+--------------------+

here is the format i want to put it in. for a specific year, let’s call it 2008:

Time Completed  Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
12AM    1                                           
1AM                             2               1
2AM     1           1                   1       
3AM                                             3
4AM                 342     1                   
.                                   32          34
.                   42                          
.                                               
NEXT DAY 12AM       2                   1                   
NEXT DAY 1AM                    1                           
.                                               
.                                               

…………

DateTime Entered gives us the starting day and DateTime Completed gives us the time when completed.

for example for the first one. it would have a completed time of 14:39 whereas for the second one it would be 5th day 15:29. the third one would be 2nd day 13:40

thank you so much for your advice and guidance. i would be most grateful if you could point me into the right direction.

a SQL or SSRS solution would be ideal.

  • 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-06T16:27:28+00:00Added an answer on June 6, 2026 at 4:27 pm

    Edited to include sorting:

    create table tblTest (ID int , Entered datetime, Completed datetime)
    
    set dateformat mdy
    
    insert into tblTest values (1,'6/17/2011 10:08','6/18/2011 14:39')
    insert into tblTest values (  2 ,'5/10/2011 9:29','5/15/2011 17:29')
    insert into tblTest values (  3 ,'3/2/2009 9:30','3/3/2009 13:40')
    insert into tblTest values (  4 ,'3/3/2009 11:36','3/4/2009 16:39')
    insert into tblTest values (  5 ,'3/3/2009 11:37','3/4/2009 16:39')
    insert into tblTest values (  6 ,'3/3/2009 11:38','3/4/2009 16:39')
    insert into tblTest values (  7 ,'3/3/2009 11:38','3/4/2009 16:38')
    insert into tblTest values (  8 ,'3/3/2009 11:38','3/5/2009 9:08')
    insert into tblTest values (  9 ,'1/10/2011 9:43','1/11/2011 13:13')
    insert into tblTest values ( 10 ,'2/11/2011 12:20','2/12/2011 15:01')
    insert into tblTest values ( 11 ,'8/14/2009 10:20','8/17/2009 15:56')
    insert into tblTest values ( 12 ,'11/19/2008 9:45','11/20/2008 14:56')
    insert into tblTest values ( 13 ,'2/10/2011 13:50','2/11/2011 19:36')
    insert into tblTest values ( 14 ,'8/14/2009 10:23','8/17/2009 15:56')
    insert into tblTest values ( 15 ,'8/17/2009 9:43','8/18/2009 13:56')
    insert into tblTest values ( 16 ,'8/17/2009 9:43','8/19/2009 6:47')
    insert into tblTest values ( 17 ,'8/14/2009 10:28','8/17/2009 15:56')
    insert into tblTest values ( 18 ,'12/17/2008 10:03','12/18/2008 11:07')
    insert into tblTest values ( 19 ,'1/13/2009 9:41','1/14/2009 18:11')
    insert into tblTest values ( 20 ,'1/20/2009 9:18','1/21/2009 15:08')
    insert into tblTest values ( 21 ,'2/12/2009 10:53','2/13/2009 15:21')
    insert into tblTest values ( 22 ,'1/20/2009 9:19','1/21/2009 15:08')
    insert into tblTest values ( 23 ,'1/13/2009 9:50','1/15/2009 8:45')
    insert into tblTest values ( 24 ,'1/13/2009 9:50','1/14/2009 14:40')
    insert into tblTest values ( 25 ,'1/13/2009 9:36','1/14/2009 18:11')
    insert into tblTest values ( 26 ,'12/17/2008 10:06','12/18/2008 11:06')
    insert into tblTest values ( 27 ,'12/17/2008 10:04','12/18/2008 11:06')
    insert into tblTest values ( 28 ,'3/30/2010 9:20','3/31/2010 13:44')
    insert into tblTest values ( 29 ,'1/25/2010 9:33','1/26/2010 14:20')
    insert into tblTest values ( 30 ,'1/30/2009 11:21','2/2/2009 14:44')
    insert into tblTest values ( 31 ,'6/17/2010 9:07','6/18/2010 14:17')
    insert into tblTest values ( 32 ,'6/16/2010 10:24','6/17/2010 16:20')
    insert into tblTest values ( 33 ,'6/14/2010 9:33','6/15/2010 8:52')
    insert into tblTest values ( 34 ,'5/27/2010 9:15','5/28/2010 14:15')
    insert into tblTest values ( 35 ,'5/27/2010 10:16','5/28/2010 15:51')
    insert into tblTest values ( 36 ,'5/21/2010 9:15','5/23/2010 13:05')
    insert into tblTest values ( 37 ,'5/19/2010 10:08','5/20/2010 13:33')
    insert into tblTest values ( 38 ,'6/30/2010 11:41','7/1/2010 18:16')
    insert into tblTest values ( 39 ,'6/30/2010 11:41','6/30/2010 18:16')
    insert into tblTest values ( 40 ,'1/10/2011 9:43','1/11/2011 13:13')
    
    select 
    datediff(d, CAST(entered as DATE), CAST(completed as DATE)) AS Sort_Days,
    DATEPART(hour, completed) AS Sort_Hours,
    CASE datediff(d, CAST(entered as DATE), CAST(completed as DATE))
        WHEN 0 THEN '' WHEN 1 THEN 'NEXT DAY ' WHEN 2 THEN '2ND DAY ' WHEN 3 THEN '3RD DAY ' ELSE CONVERT(varchar(10), datediff(d, CAST(entered as DATE), CAST(completed as DATE))) + 'TH DAY ' 
    END
    + CONVERT(varchar(10), DATEPART(hour, completed) - CASE WHEN DATEPART(hour, completed) > 12 THEN 12 ELSE 0 END )
    + CASE WHEN DATEPART(hour, completed) < 12 THEN 'AM' ELSE 'PM' END AS TimeCompleted,
    case when datepart(month,entered) = 1 then 1 end as Jan,
    case when datepart(month,entered) = 2 then 1 end as Feb,
    case when datepart(month,entered) = 3 then 1 end as Mar,
    case when datepart(month,entered) = 4 then 1 end as Apr,
    case when datepart(month,entered) = 5 then 1 end as May,
    case when datepart(month,entered) = 6 then 1 end as Jun,
    case when datepart(month,entered) = 7 then 1 end as Jul,
    case when datepart(month,entered) = 8 then 1 end as Aug,
    case when datepart(month,entered) = 9 then 1 end as Sep,
    case when datepart(month,entered) = 10 then 1 end as Oct,
    case when datepart(month,entered) = 11 then 1 end as Nov,
    case when datepart(month,entered) = 12 then 1 end as Dec
    into #tblTest
    from tblTest
    
    select TimeCompleted, sum(Jan), sum(Feb), sum(Mar), sum(Apr), sum(May), sum(Jun), sum(Jul), sum(Aug), sum(Sep), sum(Oct), sum(Nov), sum(Dec)
    from #tblTest
    group by TimeCompleted, Sort_Days, Sort_Hours
    order by Sort_Days, Sort_Hours
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume the following xml input... <incidents> <incident> <year>2011</year> <other data here> </incident> <incident> <year>2009</year>
I want to read an XML file located here The data looks like this
In one place of code I do something like this: FormModel(.. some data here..).put()
I have created an xml file here: /data/data/com.appName/emergency.xml Now I want to access this
Data: Here is sample table(TableA) data ID StartTime EndTime 1 2012-03-22 06:00:00.000 2012-03-22 06:30:00.000
I am sending HTTP GET request and receiving data here: ssize_t numBytes = recvfrom(sock,
I'm learning assembly and I have a very basic loop here segment .data msg:
for (i = 0; i < 14; i++) { //display data here } Console.WriteLine({0},
My html is like this <div id=rsContainer> <table id=rsTable><!-- DATA HERE --></table> </div> and
Here is my data returned from a CMS function: array ( 0 => stdClass::__set_state(array(

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.