April 13, 2012 at 3:56 pm
that creates all of your counts. you will need to modify the queries to get your wheres back in since i saw you included only one OrderHeader_ID
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
April 16, 2012 at 7:28 am
ok, never seen that structure before haha..so would i just form the query around everything you pasted? and whats with the ";" at the beginning
April 16, 2012 at 7:30 am
ewhitaker (4/16/2012)
ok, never seen that structure before haha..so would i just form the query around everything you pasted? and whats with the ";" at the beginning
Read up on CTEs - they need to start with a semi-colon unless they are the first statement in a batch.
April 16, 2012 at 7:56 am
ah..ok..i will read up on it...thanks
April 16, 2012 at 10:14 am
AHHHHHHHHHHHHH ... was skeptical at first, but did what you said and it worked...made other adjustments ,,,but dude..seriously thanks..i just found out plan b today if it didnt..and you saved me a ridiculous amount of stupid work
April 16, 2012 at 10:17 am
Phil Parkin (4/16/2012)
ewhitaker (4/16/2012)
ok, never seen that structure before haha..so would i just form the query around everything you pasted? and whats with the ";" at the beginningRead up on CTEs - they need to start with a semi-colon unless they are the first statement in a batch.
Actually the statement previous to the WITH (CTE) needs to be terminated with a semi-colon.
April 16, 2012 at 10:26 am
Actually the statement previous to the WITH (CTE) needs to be terminated with a semi-colon.
Grrrr! Correct 🙂
April 16, 2012 at 10:33 am
Phil Parkin (4/16/2012)
Actually the statement previous to the WITH (CTE) needs to be terminated with a semi-colon.
Grrrr! Correct 🙂
when posting code i always put the semi colon infront of the WITH if there is no other statement before it otherwise it terminates the line before it at the end of the line.
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]
April 16, 2012 at 10:40 am
capn.hector (4/16/2012)
Phil Parkin (4/16/2012)
Actually the statement previous to the WITH (CTE) needs to be terminated with a semi-colon.
Grrrr! Correct 🙂
when posting code i always put the semi colon infront of the WITH if there is no other statement before it otherwise it terminates the line before it at the end of the line.
All I am trying to point out is the the [;] doesn't go at the front of the CTE. The syntax for the CTE specifies that if the CTE (WITH) is not the first statement in a batch that the previous statement must be terminated by a [;]. How everyone actually does the code, I'm not going to argue with unless I happen to be the gatekeeper to the database through which the code must travel. then I will insist that the [;] terminate the previous statement, not preceed the WITH.
Viewing 9 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply