Viewing 15 posts - 301 through 315 (of 399 total)
solved syntax of adding pivot, am still analyzing results. At least this runs without error.
SELECT yrOrdered, moOrdered, DayOrdered, [1], [2], [3]
from
(
select YEAR(orderdate)as yrOrdered, MONTH(orderdate) as moOrdered, DAY(orderdate) as dayOrdered,...
July 29, 2012 at 6:18 pm
Still having problem adding pivot to group by with rollup sql query. Can anyone help?
SELECT yrOrdered, moOrdered, DayOrdered, COUNT(orderid) as countofOrders
from
(
select YEAR(orderdate)as yrOrdered, MONTH(orderdate) as moOrdered, DAY(orderdate) as dayOrdered, empid,...
July 29, 2012 at 6:10 pm
Lokesh, I have seen that information too, but it is the 'expansion into' pivot that is the problem and for which I can't find demo.
EG, I see how to apply...
July 28, 2012 at 8:18 pm
I don't see how the substitution of my actual column name would work in either dwain or ColdCoffee's case. 🙁
SELECT MyStr=REVERSE(SUBSTRING(REVERSE(MyStr3), 1, CHARINDEX('_', REVERSE(MyStr3))-1))
FROM TestData
CROSS APPLY (SELECT LTRIM(REPLACE(MyStr +...
June 27, 2012 at 10:58 pm
Gsquared, will you please show me how to use your "Here's something a bit flexible for this kind of thing:"?
I have another example.
Two things need to happen:
1)remove everything after the...
June 27, 2012 at 9:54 pm
Lynn, But, you helped me. You might admit, that one is logistically quite complicated ...and utilizing a function I have not run into yet. This worked. This was the answer....
June 12, 2012 at 1:23 pm
The problem is complicated by this: the values I need to retain (before the first backslash) also have a prefix that needs to be removed.
So two things need to...
June 12, 2012 at 11:36 am
No, I am getting error:
Msg 537, Level 16, State 2, Line 1
Invalid length parameter passed to the LEFT or SUBSTRING function.
even if I go
SELECT CASE when CHARINDEX('/', ProdPath)...
June 11, 2012 at 1:31 pm
This time, I'm trying to get everything in front of the first backslash of a field name. The values in ProdPath will never begin with a backslash, and may...
June 11, 2012 at 12:58 pm
Jeff, rather uncanny that you would know I might need to...."Return a BLANK if there's no backslash after the 2nd character".
I needed this today. Thanks again.
June 6, 2012 at 5:58 am
thanksk Know-It-All.
that worked great. Let me apply what you just taught me to my real life scenario. Thanks a lot!
Note*
I had to correct my FK constraint to make...
May 30, 2012 at 2:58 pm
yes, this will be one time and I am seperating the migrations into two batches. destination A is already populated, but destinationB is populated based on more complex...
May 30, 2012 at 2:37 pm
SoberCounsel
Each time you call the PivotTableWizard it adds a new sheet (with a new pivottable on it), so if you want the pivot to appear on a specific sheet,...
May 28, 2012 at 4:39 am
yes that did it.
I realize I have a lot I'm going to have to learn on my own, which is why I am reading VB for Dummies. I plan...
May 21, 2012 at 11:27 am
Viewing 15 posts - 301 through 315 (of 399 total)