Viewing 15 posts - 3,016 through 3,030 (of 3,480 total)
If you have 2012, then here's an example of a running total using window functions (from Itzik Ben-Gan's book on Window functions in 2012):
SELECT empID, qty,
SUM(qty) OVER (PARTITION BY empID
...
May 11, 2014 at 3:20 pm
Maybe my brain is not working, but if you can return a set of punch in/outs for an employee, shouldn't you be able to use ROWNUMBER() to get odd (clock...
May 11, 2014 at 1:19 pm
So this was a simplified example?
If you're having trouble implementing a more complex solution, post the table info and the expected result.
May 10, 2014 at 8:41 pm
Now to implement in a much more complex way. 🙂
Umm... Okay! I hope you're being facetious!
May 10, 2014 at 6:23 pm
This is close:
WITH cteList(col1, col2, freq) AS
(SELECT col1, col2, count(*) OVER (PARTITION BY col1, col2) AS Freq
FROM (
SELECT 'John' AS col1,1 as col2,1 as col3
UNION ALL
SELECT 'John',1,1
UNION ALL
SELECT 'John',2,2
UNION ALL
SELECT...
May 9, 2014 at 9:18 pm
This is the article I was thought might help:
http://www.sqlservercentral.com/scripts/Miscellaneous/31733/
May 8, 2014 at 10:57 am
What you're describing is called a data-driven subscription. What version of SQL Server are you using? Enterprise supports them natively. If not, I am pretty sure that Jason...
May 7, 2014 at 4:19 pm
Why not just use a junction table? Normally, the junction table holds the foreign keys from the two parent tables and then any information that is specific to the...
May 5, 2014 at 12:07 pm
Create a calculated column in your dataset for the year.
YEAR(SomeDate)
Then you should be able to group no problem.
May 1, 2014 at 7:47 am
Do you understand the difference between an OLTP database structure and a DW database structure? Which part are you having trouble with? The star schema?
April 29, 2014 at 3:50 pm
If you can get your hands on a copy, read a little of Ralph Kimball's Data Warehouse Toolkit
April 29, 2014 at 2:46 pm
Sorry, I completely missed this. What you describe is exactly what I ended up doing. Lots of parameterized subreports that I could include in a "main" report. ...
April 28, 2014 at 2:48 pm
I think I managed to reproduce your problem... and I think I solved it.
First off, some data to play with that I used as the data source for my report:
SELECT...
April 26, 2014 at 8:28 pm
Oh, super cool! Guess I'll have to test and see if it is happy on Win7 or another non-Server OS.
Thanks!
April 26, 2014 at 6:06 pm
Are you trying to create a single dataset to use in your report? If so, it looks like you can union the results together.
SELECT...
FROM v_SomeView
WHERE...
UNION ALL
SELECT...
FROM v_SomeOtherView
WHERE...
and then...
April 26, 2014 at 1:41 pm
Viewing 15 posts - 3,016 through 3,030 (of 3,480 total)