Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2004, 04:21 PM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Too few parameters. Expected 1.

I am doing patient appointment booking program. The script that I'm trying to write now checks all the available appointments from the table appointments.

I am having this error on my program, Too few parameters. Expected 1.

Here is the sql statement.

idTrue = Request.QueryString("id")
dateTrue = Request.QueryString("dateSelect")
monthTrue = Request.QueryString("monthSelect")
empTrue = Request.QueryString("emp1")

strSQL = "SELECT staff.Name, staff.staffID, appointments.Date, appointments.Month, appointments.Time, appointments.appointment_booked, patientss.LoginID FROM (staff INNER JOIN appointments ON staff.staffID = appointments.staffID) INNER JOIN patientss ON staff.staffID = patientss.staffID WHERE (((appointments.Date)=" + dateTrue + ") AND (( appointments.Month)='" + monthTrue + "') AND ((appointments.appointment.booked)=No) AND ((patientss.LoginID)='" + idTrue + "'));"

rsSearch.Open strSQL, MyConn

I have got three tables with the following attributes.

Patientss(LoginID, staffID, appointmentID, Title, Last_name.....)
staff(staffID, Name, Job_title..)
appointments(appointmentID, staffID, Date, Time, Month, appointment_booked..)

CAN ANY TELL ME HOW TO SORT IT OUT.


 
Old April 27th, 2004, 01:03 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would check the format of the dateTrue value and make sure it is in a recognizable format. (e.g. m/d/yy, etc.)

Also this snippet for the date:

((appointments.Date)=" + dateTrue + ")

is missing the ' (single quotes) like:

((appointments.Date)='" + dateTrue + "')

Does your Date field keep only the date portion of a datetime value? If not, you can't simply compare it with "=" because for example 4/26/04 11:03PM <> 4/26/04.

 
Old May 26th, 2004, 04:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Please check this page.
http://support.microsoft.com/default...b;en-us;216425

CAUSE
This error occurs only with Microsoft Access when one of the column names specified in a select statement does not exist in the table being queried.


You are missing something there.

_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
update stt- Too few parameters. Expected 1. s_sanks Classic ASP Databases 0 March 7th, 2008 08:03 AM
too few parameters expected 1 jim11 Access VBA 1 December 7th, 2005 03:41 PM
Too few parameters. 1 expected !!! chacquard Access VBA 2 June 21st, 2005 08:00 AM
too few parameters expected n desprate Access VBA 6 April 29th, 2005 06:33 AM
Error "Too Few Parameters - Expected 1" timmaher Access VBA 2 August 31st, 2004 04:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.