Viewing 10 posts - 1 through 10 (of 10 total)
Now it looks like it's correct for all rows in my data set. I've been working on a new solution on my own but didn't get correct result when the range...
November 20, 2023 at 12:44 pm
Thank you Ken for you input. Your solution doesn't expand the intervals and that makes it really fast. But it doesn't produce correct result. In this scenario the final row...
November 20, 2023 at 11:08 am
The top two CTEs could be replaced with only one. Possibly the bottom two could be combined as well using the "smudge" method?
Thank you for your input Steve. Your...
November 20, 2023 at 11:02 am
This gives the same results as Ken's query. (NOTE: I changed your permanent table to a temp table.)
WITH InOutStatuses AS
(
SELECT ts.GroupingId, i.InOutDate,...
October 17, 2023 at 3:59 pm
Thanks for your reply.
I've tested the query on a larger set of testdata and it's very fast. But will experiment with distinct as well.
October 17, 2023 at 2:25 pm
Wow that is so amazing, thank you so much!
One qustion: whats the purpose of
THEN DATEADD(minute, DATEDIFF(minute, '2020', T.StartDateTime), '2020')
ELSE DATEADD(minute, DATEDIFF(minute, '2020', T.EndDateTime), '2020')
instead of
October 17, 2023 at 1:11 pm
I've done some testing and when I added partition by PersonId and Group7 it gives me exactly what I want.
The trick with datediff (Boundary5 in CTE Boundaries) was what I...
February 21, 2023 at 10:02 am
Thank you all for the tips and insights.
When I discovered this I started by unistall everything that had to do with SQL Server, and installed it again. All previous instances...
November 8, 2016 at 4:41 am
When I run that query and display the results as text I goes on and on for over a minute, then I stopped. Displaying over 40K rows.
If I run it...
November 7, 2016 at 1:09 am
Thank you for your reply!
Unfortunally I can't see wierd with memory och I/O.
But I just saw that if I display the results to text instead of grid there is no...
November 7, 2016 at 12:46 am
Viewing 10 posts - 1 through 10 (of 10 total)