paulstrovsky
Programmer
Hi all,
I have a query that loops through weeks in order to sum up hours worked by employees. Everything works fine, except I get multiple result sets if I do this query without using a temp table. I figure there must be some way to work the UNION operator in at the beginning of the loop so that I can combine all the result sets into one. Any ideas?
Please don't say "Use a temporary table" because I am trying to do this without using one (I know I'm a dork).
Is there a way to UNION my loop? I get an error when I stick a UNION right after my BEGIN statement.
Thanks!
Paul
I have a query that loops through weeks in order to sum up hours worked by employees. Everything works fine, except I get multiple result sets if I do this query without using a temp table. I figure there must be some way to work the UNION operator in at the beginning of the loop so that I can combine all the result sets into one. Any ideas?
Please don't say "Use a temporary table" because I am trying to do this without using one (I know I'm a dork).
Is there a way to UNION my loop? I get an error when I stick a UNION right after my BEGIN statement.
Thanks!
Paul