Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bassist695
Starting Member
9 Posts |
Posted - 2005-03-25 : 10:03:44
|
I need to loop an entire SQL statement so that it runs for each month in an accounting range. I can accomplish this in a stored procedure, but that just adds another level of complexity.What syntax capabilities do we have in the Free SQL area when you're building datasets? What I mean by that is the dataset SQL that looks like:=IIF(Parameters!code.Value=1,"SELECT code FROM t_code","SELECT other FROM t_code")Can this SQL be looped based on parameters?Thanks,Mike |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2005-03-25 : 10:42:09
|
>>I need to loop an entire SQL statement so that it runs for each month in an accounting rangedoubtful. Why don't you post your SQL statement and an explaination of the data you have and what you are trying to return? We should be able to help you write it as a single SELECT w/o any loops or anything like that. - Jeff |
 |
|
bassist695
Starting Member
9 Posts |
Posted - 2005-03-29 : 17:44:55
|
Is that doable without a stored procedure?Mike |
 |
|
|
|
|