>
There is an extra not needed ( before FROM. Remove it and the query should work. >
>I'm not sure that's the only issue - the final SELECT in conjunction with the PIVOT seemed like it needed more. But without the data, wasn't positive. That's why I suggested the sanity check of the static base query first.
Right, but since he got the SQL printed, he should be able to copy it, remove the extra ( and test. If it bombs, we'll see the next error.
If it's not broken, fix it until it is.
My Blog