We have a rather lengthly quartly report that requires 85 queries aggregating demographics.
I built a dynaminic query where the variables change for the quarter but I can't get the assignment @QtrCnt to work.
Any Ideas?? Thanks in advance. This code is shortened to focus on the problem.
Declare @Str varchar(1000),@QtrCnt int
Set @Str='Select @QtrCnt=Count(*) from Fd_clients'
Exec (@Str)
Generates this error:
Must declare the variable '@QtrCnt'.
I built a dynaminic query where the variables change for the quarter but I can't get the assignment @QtrCnt to work.
Any Ideas?? Thanks in advance. This code is shortened to focus on the problem.
Declare @Str varchar(1000),@QtrCnt int
Set @Str='Select @QtrCnt=Count(*) from Fd_clients'
Exec (@Str)
Generates this error:
Must declare the variable '@QtrCnt'.