Avatar of davidi1
davidi1
Flag for India asked on

ASP, SQL Loop Question

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

Using:
Classic ASP, MS SQL 2008

What I have currently:
Have a form in classic asp which captures report details & its frequency (recurrence)
Ex:
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.
Ex:
ReportName  ReportDate
ABC                03/29/2013
ABC                04/01/2013
etc.,

Can someone guide me with a loop query which can save the output to another table pls
Microsoft SQL Server 2008ASP

Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott Fell

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Scott Fell

If you are not sure how to create a recordset

http://www.w3schools.com/ado/ado_recordset.asp

Those samples are for using access.  For sql server you need a connection string http://connectionstrings.com/sql-server-2008 and your web host can help you determine which to use.

Please let us know which parts you need more help with.
Your help has saved me hundreds of hours of internet surfing.
fblack61