troubleshooting Question

ASP, SQL Loop Question

Avatar of davidi1
davidi1Flag for India asked on
ASPMicrosoft SQL Server 2008
2 Comments1 Solution462 ViewsLast Modified:
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

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
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros