Print Page | Close Window

Show only current month

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2489
Printed Date: 29 March 2026 at 10:03am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Show only current month
Posted By: judo2000
Subject: Show only current month
Date Posted: 07 May 2003 at 4:37pm

I have an application that allows students to access their work schedule via the web.  The page goes thgouth and displayes the schedules by month but I want to have it list only the current month and not past months.  I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

employ/staff/includes/coorsFitnessSched.asp line 6

My code is:

Dim curMonth
curMonth = MonthName(month(date))

strSQL = "SELECT staffSched.*, employees.* FROM staffSched, employees WHERE employees.empID = staffSched.empID AND staffSched.venueID = 2 AND staffSched.month=" curMonth
       
 rsSchedules.Open strSQL, adoCon
         
 if NOT rsSchedules.EOF THEN
          
  response.Write("<tr>")
  response.Write("<td colspan='9' align='center' bgcolor='#699999'>")
  response.Write("<span class='tableHead'>")
  response.Write(rsSchedules("month"))
  response.Write("</span>")
  response.Write("</td>")
  response.Write("</tr>")       
  response.Write("<tr>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Week")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Name")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Sunday")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Monday")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Tuesday")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Wednesday")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Thursday")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Friday")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("<td align='center'>")
  response.Write("<span class='tableSubHead'>")
  response.Write("Friday")
  response.Write("</span>")
  response.Write("</td>")
  response.Write("</tr>")
  DO WHILE NOT rsSchedules.EOF
   response.Write("<td align='center'>")
   response.Write("<span class='tableSubHead'>")
   response.Write(rsSchedules("week"))
   response.Write("</span>")
   response.Write("</td>")
   response.Write("<td class='tableSubHead'>")
   response.Write(rsSchedules("empFName") & " " & rsSchedules("empLName") )
   response.Write("</td>")
   response.Write("<td class='bodyTxt'>")
   if rsSchedules("Sun") = "Time" THEN
    response.Write("&nbsp;")
   ELSE
    response.Write(rsSchedules("Sun"))
   END if
   response.Write("</td>")
   response.Write("<td class='bodyTxt'>")
   if rsSchedules("Mon") = "Time" THEN
    response.Write("&nbsp;")
   ELSE
    response.Write(rsSchedules("Mon"))
   END if
   response.Write("</td>")
   response.Write("<td class='bodyTxt'>")
   if rsSchedules("Tue") = "Time" THEN
    response.Write("&nbsp;")
   ELSE
    response.Write(rsSchedules("Tue"))
   END if
   response.Write("</td>")
   response.Write("<td class='bodyTxt'>")
   if rsSchedules("Wed") = "Time" THEN
    response.Write("&nbsp;")
   ELSE
    response.Write(rsSchedules("Wed"))
   END if
   response.Write("</td>")
   response.Write("<td class='bodyTxt'>")
   if rsSchedules("Thu") = "Time" THEN
    response.Write("&nbsp;")
   ELSE
    response.Write(rsSchedules("Thu"))
   END if
   response.Write("</td class='bodyTxt'>")
   response.Write("<td>")
   if rsSchedules("Fri") = "Time" THEN
    response.Write("&nbsp;")
   ELSE
    response.Write(rsSchedules("Fri"))
   END if
   response.Write("</td>")
   response.Write("<td class='bodyTxt'>")
   if rsSchedules("Sat") = "Time" THEN
    response.Write("&nbsp;")
   ELSE
    response.Write(rsSchedules("Sat"))
   END if
   response.Write("</td>")
   response.Write("</tr>")
   rsSchedules.MoveNext
  Loop
 ELSE 
 END if



-------------
If you are not willing to work hard to realize your dreams, why bother dreaming?



Replies:
Posted By: ultramods
Date Posted: 07 May 2003 at 4:47pm
Where is the error?


Posted By: judo2000
Date Posted: 07 May 2003 at 4:52pm

Sorry, I edited the post above but here it is also:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

employ/staff/includes/coorsFitnessSched.asp line 6

Thanks



-------------
If you are not willing to work hard to realize your dreams, why bother dreaming?


Posted By: judo2000
Date Posted: 07 May 2003 at 5:11pm

I found the answer:

strSQL = "SELECT staffSched.*, employees.* FROM staffSched, employees WHERE employees.empID = staffSched.empID AND staffSched.venueID = 2 AND staffSched.month=" curMonth

should be

strSQL = "SELECT staffSched.*, employees.* FROM staffSched, employees WHERE employees.empID = staffSched.empID AND staffSched.venueID = 2 AND staffSched.month='" & curMonth & "'"



-------------
If you are not willing to work hard to realize your dreams, why bother dreaming?


Posted By: ultramods
Date Posted: 07 May 2003 at 5:17pm

first try this:

strSQL = "SELECT staffSched.*, employees.* FROM staffSched, employees WHERE employees.empID = staffSched.empID AND staffSched.venueID = 2 AND staffSched.month=' " & curMonth & " ' "



Posted By: ultramods
Date Posted: 07 May 2003 at 5:20pm
I should learn to refresh the page more often.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net