[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Grouping + fill empty spaces

Asked by pmengal in MS SQL Server

Tags: empty, fill, space, data, sql

Hello,

Consider this table structure / data :

Column :     Connexions         DateRecorded        
Row1 :           10                         1/1/2007 11:12:45 pm              
Row2 :           11                         1/1/2007 11:17:12 pm              
Row3 :           13                          1/1/2007 11:17:59 pm              
Row4 :           12                         1/1/2007 11:25:11 pm              
Row5 :            11                         1/1/2007 11:26:13 pm              
Row6 :            10                         1/1/2007 11:28:52 pm              
Row7 :            9                         1/1/2007 11:28:59 pm              
Row8 :            8                         1/1/2007 11:41:00 pm              
Row9 :            7                         1/1/2007 11:47:15 pm              

Based on that table, I want to retrieve all the data from 11:12 to 12h00 (the getDate() returns 12:00:00), group by minute to get this :

Column :     Connexions         DateRecorded        
Row1 :           10                         1/1/2007 11:12
Row2 :           10                         1/1/2007 11:13
Row3 :           10                         1/1/2007 11:14
Row4 :           10                         1/1/2007 11:15
Row5 :           10                         1/1/2007 11:16
Row6 :           13                          1/1/2007 11:17
Row7 :           13                          1/1/2007 11:18
Row8 :           13                          1/1/2007 11:19
Row9 :           13                          1/1/2007 11:20
Row10 :           13                          1/1/2007 11:21
Row11 :           13                          1/1/2007 11:22
Row12 :           13                          1/1/2007 11:23
Row13 :           13                          1/1/2007 11:24
Row14 :           12                         1/1/2007 11:25
Row15 :            11                         1/1/2007 11:26
Row16 :            11                         1/1/2007 11:27
Row17 :            10                         1/1/2007 11:28
Row18 :            10                         1/1/2007 11:29
Row19 :            10                         1/1/2007 11:30
Row20 :            10                         1/1/2007 11:31
Row21 :            10                         1/1/2007 11:32
Row22 :            10                         1/1/2007 11:33
Row23 :            10                         1/1/2007 11:34
Row24 :            10                         1/1/2007 11:35
Row25 :            10                         1/1/2007 11:36
Row26 :            10                         1/1/2007 11:37
Row27 :            10                         1/1/2007 11:38
Row28 :            10                         1/1/2007 11:39
Row29 :            10                         1/1/2007 11:40
Row30 :            8                         1/1/2007 11:41
Row31 :            8                         1/1/2007 11:42
Row32 :            8                         1/1/2007 11:43
Row33 :            8                         1/1/2007 11:44
Row34 :            8                         1/1/2007 11:45
Row35 :            8                         1/1/2007 11:46
Row36 :            7                         1/1/2007 11:47

Please note that we do a MAX for grouping, so we keep the MAXIMUM value of the grouped records for the same minute. The complexity is to fill the record for each minute that is not on the table.

If it's not possible with a single SQL query, a stored proc is OK ;)

Thanks!
[+][-]12/16/06 07:19 AM, ID: 18151736Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/16/06 09:13 AM, ID: 18152052Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/16/06 09:21 AM, ID: 18152064Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/16/06 10:35 AM, ID: 18152240Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/16/06 11:40 AM, ID: 18152371Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/16/06 11:56 AM, ID: 18152403Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/17/06 07:13 PM, ID: 18156462Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/18/06 02:09 PM, ID: 18162108Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: MS SQL Server
Tags: empty, fill, space, data, sql
Sign Up Now!
Solution Provided By: ScottPletcher
Participating Experts: 3
Solution Grade: A
 
[+][-]02/06/07 09:54 PM, ID: 18482743Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89