davidi1
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:
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
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.