Viewing 15 posts - 1,711 through 1,725 (of 3,507 total)
You could pivot this stuff in a Matrix in SSRS and be done already. Is that not an option? Wouldn't be if you had to output this result for...
November 24, 2016 at 9:11 pm
How many possible combinations are there for "formula"? You could write a CASE statement that determined which formula to use to calculate the answer... surely must be faster than a...
November 23, 2016 at 10:00 pm
Took me a minute... if you use Windowing functions (requires SQL 2012 or later), then this is easy. The PARTITION basically groups the records together... then you can use...
November 23, 2016 at 9:01 pm
Maybe a ForEach table loop and a LEFT OUTER JOIN?
November 23, 2016 at 5:10 pm
If you split the Date and Time fields into two different columns in SQL Server, then this query is trivial.
November 23, 2016 at 2:03 pm
Don't understand why you think you need windowing functions...
Does this do what you want? The inner query, inside the parentheses... query "x", gets the counts for each grouping, and then...
November 23, 2016 at 1:37 pm
Self-joins with aggregates. YUCK.
How about something really simple... maybe like this?
SELECT PatientID
, SessionID
, SessionTime
, LAG([SessionTime]) OVER (PARTITION BY PatientID ORDER BY SessionTime) AS PrevSession
FROM
(SELECT 1 AS PatientID, 1 AS SessionID,...
November 21, 2016 at 6:02 pm
Well, you can't turn columns into rows from that... there's nothing to pivot on.
November 21, 2016 at 3:32 pm
Can you please explain the logic of how to get the result you're looking for? Maybe I'm slow, but that part baffles me. Maybe there's something you understand about the...
November 21, 2016 at 2:56 pm
Are there tables with the data in it somewhere that you could share? From your sample data, it's not entirely clear which columns belong in which logical group (table).
1234...
November 21, 2016 at 12:34 pm
Viewing 15 posts - 1,711 through 1,725 (of 3,507 total)