<% actionVar = request.querystring("action") SELECT CASE UCASE(actionVar) CASE "WAINPUT" %>

Enter a Starting Date:

Enter the start date like "01/02/2002", then number of days, i.e. 7 will report a week.

   Start Date

   Number of Days to Report

<% CASE "WAOUTPUT" startDateVar = CDate(request.form("startdate")) duration = Cint(request.form("duration")) - 1 SQL = "SELECT [class_datetime_tbl].[class_datetime],[class_datetime_tbl].[class_capacity], " SQL = SQL & "[class_datetime_tbl].[class_enrolled],[class_tbl].[class_name], [staff_tbl].[staff_name]," SQL = SQL & " [staff_tbl].[staff_phone], [staff_tbl].[staff_email]" SQL = SQL & "FROM (class_tbl INNER JOIN class_datetime_tbl ON " SQL = SQL & "[class_tbl].[class_id] =[class_datetime_tbl].[class_id])" SQL = SQL & " INNER JOIN (staff_tbl INNER JOIN staff_assignment_tbl ON" SQL = SQL & " [staff_tbl].[staff_id] =[staff_assignment_tbl].[staff_id]) " SQL = SQL & "ON [class_datetime_tbl].[class_datetime_id]" SQL = SQL & " =[staff_assignment_tbl].[class_datetime_id] WHERE " SQL = SQL & "[class_datetime_tbl].[class_datetime] " SQL = SQL & "BETWEEN #"& startDateVar &"# AND #"& (startDateVar + duration) &"# ORDER BY " SQL = SQL & "[class_datetime_tbl].[class_datetime];" Set Conn=server.createObject("adodb.connection") Conn.open "DSN=nothingtoit_7051" SET RS= SERVER.createobject("adodb.recordset") RS.open SQL, CONN, 2 Rs.movefirst 'do stuff here response.write "

Schedule Report for " & telldayofweek(startDateVar) &", "& startDateVar & " through " & telldayofweek(startDateVar + duration) & ", " & (startDateVar + duration) &"

" response.write "

Printed at: " & Now() & "


" response.write "" WHILE NOT RS.EOF IF tempdate <> rs("class_datetime") then 'were dealing with a different class now... 'first write the date and put it in a variable to be compared tempDate = rs("class_datetime") response.write "" 'now indent a little and write the name of the class... response.write "" 'now write the first name response.write "" ELSE response.write "" END IF Rs.movenext WEND response.write "
"& telldayofweek(tempdate)& ", "& trimseconds(tempdate) &"  
     "& UCASE(rs("class_name")) & " Sold at "&formatpercent((rs("class_enrolled")/rs("class_capacity")), 1)&"Class Capacity: "&rs("class_capacity")&"Class Enrolled: "&rs("class_enrolled")&"
          "&rs("staff_name")& "" & rs("staff_phone") & ""& rs("staff_email") &"
          "&rs("staff_name")& "" & rs("staff_phone") & ""& rs("staff_email") &"
" rs.close set rs = nothing conn.close set conn = nothing CASE "ARINPUT" %>

Select an Employee:

Select the staff member, a start date like "1/2/2002", then the number of days, i.e. 7 will report a week.

   Start Date

   Start Date

   Number of Days to Report

<% CASE "AROUTPUT" duration = Cint(request.form ("duration")) -1 empidVar = Cint(request.form("empid")) startDateVar = CDate(request.form("startdate")) SQL = "SELECT [class_datetime_tbl].[class_datetime], " SQL = SQL & "[class_tbl].[class_name], [staff_tbl].[staff_name], " SQL = SQL & "[staff_tbl].[staff_phone], [staff_tbl].[staff_email] " SQL = SQL & "FROM (class_tbl INNER JOIN class_datetime_tbl ON [class_tbl].[class_id]" SQL = SQL & " =[class_datetime_tbl].[class_id]) INNER JOIN (staff_tbl INNER JOIN " SQL = SQL & "staff_assignment_tbl ON [staff_tbl].[staff_id] " SQL = SQL & "=[staff_assignment_tbl].[staff_id]) ON " SQL = SQL & "[class_datetime_tbl].[class_datetime_id] " SQL = SQL & "=[staff_assignment_tbl].[class_datetime_id]" SQL = SQL & "WHERE ( [staff_tbl].[staff_id] = "& empidVar &") AND [class_datetime_tbl].[class_datetime]" SQL = SQL & " BETWEEN #"& startDateVar &"# and #"& (startdatevar+duration)&"#;" '------------------ Set Conn=server.createObject("adodb.connection") Conn.open "DSN=nothingtoit_7051" SET RS= SERVER.createobject("adodb.recordset") RS.open SQL, CONN, 2 Rs.movefirst 'do stuff here response.write "

"& rs("staff_name")&"'s schedule for " & telldayofweek(startDateVar) &", "& startDateVar & " through " & telldayofweek(startDateVar + duration) & ", " & (startDateVar + duration) &"

" response.write "

Employee Phone Number: " & rs("staff_phone") & "

" response.write "

Employee Email: "& rs("staff_email") &"

" response.write "

Printed at: " & Now() & "


" response.write "" WHILE NOT RS.EOF IF tempdate <> rs("class_datetime") then 'were dealing with a different class now... 'first write the date and put it in a variable to be compared tempDate = rs("class_datetime") response.write "" 'now indent a little and write the name of the class... response.write "" 'now write the first name 'response.write "" ELSE 'response.write "" END IF Rs.movenext WEND response.write "
"& telldayofweek(tempdate)& ", "& trimseconds(tempdate) &"  
     "& UCASE(rs("class_name")) & "  
          "&rs("staff_name")& "" & rs("staff_phone") & ""& rs("staff_email") &"
          "&rs("staff_name")& "" & rs("staff_phone") & ""& rs("staff_email") &"
" rs.close set rs = nothing conn.close set conn = nothing CASE ELSE response.write "An Error Has Occured." End Select %>