Link to home
Start Free TrialLog in
Avatar of davidi1
davidi1Flag for India

asked on

ASP, SQL Loop Question

Team - Good Morning. I'm kind of confused with the asp, sql loop.

Classic ASP, MS SQL 2008

What I have currently:
Have a form in classic asp which captures report details & its frequency (recurrence)
ReportName : ABC
ReportFrequency: Daily
ReportPattern: Weekdays
StartDate: 03/29/2013
EndDate: 03/29/2014

Like daily, users will have options to choose weekly / monthly too & the pattern will change accordingly.

I also have a fiscal calendar table which has actualdate, fiscalweek etc.,

Using this query for "daily" Example:
Select cast(convert(varchar(10), ActualDate ,102) as datetime) AS ActualDate From tblFiscalYearNew Where 
ActualDate Between '03/29/2013' AND '03/29/2014' AND FiscalDayDescription NOT IN ('Saturday','Sunday') Order BY ActualDate ASC

Open in new window

I am able to get the report instances(dates)

However I am stuck at this step.

Now, I need to use a query / loop to use the rest of the details + each date in a table.
ReportName  ReportDate
ABC                03/29/2013
ABC                04/01/2013

Can someone guide me with a loop query which can save the output to another table pls
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you are not sure how to create a recordset

Those samples are for using access.  For sql server you need a connection string and your web host can help you determine which to use.

Please let us know which parts you need more help with.