Viewing 7 posts - 46 through 52 (of 52 total)
Luis Cazares (1/15/2014)
SELECT Part#, CustomerID, ca1.Wk_Num, ca1.Qty
FROM MyTable
CROSS APPLY (
VALUES(1,Wk1),
(2,Wk2),
(3,Wk3),
(4,Wk4),
--...
(52,Wk52)
)...
January 15, 2014 at 3:55 pm
That one looks pretty slick. I'll try that.
I made do with a stored proc and dynamic sql that loops through an insert statement, but, it's not cooperating...
January 15, 2014 at 3:47 pm
Thanks Scott. Not sure that would quite work for my data, but since I didn't post any data, how would anyone know that.
January 15, 2014 at 3:19 pm
Thanks Luis. I'm seeing how the lack of data samples is not helping.
I'll try what you posted. Sorry, I didn't think to look at links. I just...
January 15, 2014 at 3:10 pm
also, to whomever, some code examples regarding exactly what I'm trying to do would be helpful.
Thanks.
January 15, 2014 at 1:23 pm
As I said, I tried unpivot, but didn't see a way to get the week_num value in there from the wk# column name.
I'll look at cross apply.
January 15, 2014 at 1:20 pm
And I just found "select / union all" will only work up to 19 iterations, and after that it starts saying it can't find columns.
January 15, 2014 at 12:28 pm
Viewing 7 posts - 46 through 52 (of 52 total)