Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

SSRS While Loop in the DataSet Query

$
0
0

Hello,

I have the stored procedure that has a while loop that will not work in SSRS but the query works in Studio Manager.    The data needs to display the total number of open production orders by date

set seldays = 0

set numdays  =DAY(DATEADD(mm,DATEDIFF(mm,-1, @startdate),-1))--determines the number of days in that month

while

@seldays<@numdays

BEGIN

Select data from table where (closedate =0 or(closedate=cast(CONVERT(varchar(20),dateadd(day,@seldays,@startdate),112)asINT)))                     

 and createdate <=cast(CONVERT(varchar(20),dateadd(day,@seldays,@startdate),112)asINT);

set @seldays = @seldays + 1

 end

I have searched through numerous websites and a basic SSRS Reporting Tutorial. 

I just do not see an answer to handle looping in SSRS

I have tried using this as a procedure or query

Thank you for your help with this matter


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>