Viewing 15 posts - 6,676 through 6,690 (of 8,731 total)
I'm not great at PIVOT, because I usually use CROSS TABS because they're more flexible to work with.
Here's an example with your problem.
To know more about dynamic CROSS TABS: http://www.sqlservercentral.com/articles/Crosstab/65048/
To...
March 26, 2014 at 10:26 am
I'll try to explain it.
First, I'll create some sample data to follow along and keep it short.
CREATE TABLE #SampleData(
Criteria_Numberint,
Criteria_Namevarchar(50),
Calc_Pointsint,
Max_Pointsint);
INSERT #SampleData
SELECT 1, 'Criteria A', 5, 10 UNION ALL
SELECT 1, 'Criteria B',...
March 26, 2014 at 9:29 am
That seems to give the correct result. What's the problem? You could add an ELSE 0 to avoid having NULLs in your data.
March 25, 2014 at 7:13 pm
That's not difficult, what have you tried?
March 25, 2014 at 7:00 pm
I'm not sure what would happen with an even month, so I'm giving you 2 options.
WITH Dates AS(
SELECT CAST( '20140425' AS date) somedate UNION ALL
SELECT CAST( '20140325' AS date) somedate...
March 25, 2014 at 6:33 pm
The Dixie Flatline (3/25/2014)
March 25, 2014 at 6:25 pm
Aditya,
If you don't give an alias to the column, you don't need the nested REPLACEs. 😉
March 25, 2014 at 5:09 pm
I hope that you're ready for a great boost on performance. You didn't give any sample data, so there's a possibility that you won't get exactly what you're looking for...
March 25, 2014 at 4:28 pm
Here's an option you could explore. The range used works for almost 7 days.
The problem is that a gap between 2 Sessions can be covered by another one, so I...
March 25, 2014 at 3:39 pm
That will return all countername values containing a percentage sign before the word, not only the ones that start with the percentage sign.
March 25, 2014 at 12:59 pm
Why don't you try to get the solution?
I can't give a great advice on the reporting tool, but you should look for grouping options and totals (group footers), for T-SQL...
March 25, 2014 at 12:55 pm
Something like this?
where countername like '[%]usage%'
March 25, 2014 at 12:50 pm
RedBirdOBX (3/25/2014)
I was actually leaning towards a temp table....I will give it a try.
Note that the temp table I used is to have the sample data. You don't need to...
March 25, 2014 at 12:10 pm
Maybe some brute force can help you.
CREATE TABLE #Test(
OpenTimetime,
CloseTimetime)
INSERT #Test
SELECT '09:00:00', '17:00:00' UNION ALL
SELECT '08:00:00', '18:00:00' UNION ALL
SELECT '10:00:00', '20:00:00'
SELECT *,
DATEDIFF(MI, CASE WHEN OpenTime < '09:00:00' THEN '09:00:00'...
March 25, 2014 at 11:58 am
Viewing 15 posts - 6,676 through 6,690 (of 8,731 total)