Ask a Question related to Coldfusion Database Access, Design and Development.
-
Student_bob #1
Joining tables, Please help
<b><u>Objective: </b></u>
Join two DB tables to output two queries on a webpage.
<b><u>Problem:</b></u>
Error Diagnostic Information
ODBC Error Code = 07001 (Wrong number of parameters)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Hint: The cause of this error is usually that your query contains a reference
to a field which does not exist. You should verify that the fields included in
your query exist and that you have specified their names correctly.
The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (8:1) to (8:50).
<b><u>Code::</b></u>
<html>
<head>
<title>Roster Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<cfquery datasource="Trackclub" name="getoutdoor">
SELECT Records.EventDesc, Records_Detail.EventDate, Records_Detail.FName,
Records_Detail.LName, Records_Detail.RelayTeam, Records.Time_Mark,
Records_Detail.Location
FROM Records INNER JOIN Records_Detail ON Records.EventID =
Records_Detail.EventID
WHERE (((Records.EventID)=[records_detail].[eventid]) AND
((Records.Indoor_Outdoor)="o"))
ORDER BY Records.EventID;
</cfquery>
<cfquery datasource="Trackclub" name="getindoor">
SELECT Records.EventDesc, Records.Time_Mark, Records_Detail.FName,
Records_Detail.LName, Records_Detail.RelayTeam, Records_Detail.Location,
Records_Detail.EventDate
FROM Records INNER JOIN Records_Detail ON Records.EventID =
Records_Detail.EventID
WHERE (((Records.EventID)=[records_detail].[eventId]) AND
((Records.Indoor_Outdoor)="i"))
ORDER BY Records.EventID;
</cfquery>
<h3>Outdoor Records</h3>
<table width="75%" border="0">
<tr>
<td>Event</td>
<td>Date</td>
<td>Names (Relay Team Members)</td>
<td>Time/Mark</td>
<td>Location</td>
</tr>
<cfloop query = "getoutdoor">
<cfoutput>
<tr>
<td>#EventID#</td>
<td>#EventDate#</td>
<td>#Fname# #Lname# #RelayTeam#</td>
<td>#Time_Mark#</td>
<td>#Location#</td>
</tr>
</cfoutput>
</cfloop>
</table>
<h3>Indoor Records</h3>
<table width="75%" border="0">
<tr>
<td>Event</td>
<td>Date</td>
<td>Names (Relay Team Members)</td>
<td>Time/Mark</td>
<td>Location</td>
</tr>
<cfloop query="getindoor">
<cfoutput>
<tr>
<td>#EventID#</td>
<td>#EventDate#</td>
<td>#Fname# #Lname# #RelayTeam#</td>
<td>#Time_Mark#</td>
<td>#Location#</td>
</tr>
</cfoutput>
</cfloop>
</table>
</body>
</html>
Student_bob Guest
-
Joining three tables
Hello all, I am having a bear of a time trying to join three tables in Sybase. Here is the query...... select DISTINCT(appl.ag_id),... -
Joining Multiple Tables
I have a query that enables me to join various tables together. I managed to get all the data I need from all of the tables, aside from one, apart... -
joining 3 tables?
helooo... i have 3 tables -Recipes, Ingredients and Products. Recipes table: RecipeID -PK Ingredients table: IngredientID -PK... -
joining 3 tables in dataset
hi my problem is that i have to load 3 different tables from different databases into one dataset and do a join on all. i loaded all tables into... -
Joining Tables Across Databases
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ... -
The ScareCrow #2
Re: Joining tables, Please help
Your error is in the where clause. You have replicated the table join in the
where clause.
Also, I might be way off here, but the column Records.Indoor_Outdoor by the
name would indicate that the event is either indoors or outdoors and thus is a
Yes/No column. Is this correct ?
If so the WHERE clause should be WHERE Records.Indoor_Outdoor = 0 <!--- zero
--->
SELECT Records.EventDesc, Records_Detail.EventDate, Records_Detail.FName,
Records_Detail.LName, Records_Detail.RelayTeam, Records.Time_Mark,
Records_Detail.Location
FROM Records INNER JOIN Records_Detail ON Records.EventID =
Records_Detail.EventID
WHERE Records.Indoor_Outdoor = "o"
ORDER BY Records.EventID;
Ken
The ScareCrow Guest
-
Student_bob #3
Re: Joining tables, Please help
I made the suggested changes and it didn't work, I still got the same message.
Also the I and O are there not as a yes or no, but ironically for Indoor and
Outdoor, I can see where that'd be confusing though. Thanks again for any
other help you could provide.
Student_bob Guest
-
The ScareCrow #4
Re: Joining tables, Please help
The only things I can suggest is the following
1. Ensure that you have spelt the column names correctly
2. replace the double quotes with a single quote
WHERE Records.Indoor_Outdoor = 'o'
3. Use the ms access query builder to build the query.
Ken
The ScareCrow Guest
-
Jochem van Dieten - TMM #5
Re: Joining tables, Please help
Student_bob wrote:
> <b><u>Objective: </b></u>
> Join two DB tables to output two queries on a webpage.
>
> <b><u>Problem:</b></u>
> Error Diagnostic Information
> ODBC Error Code = 07001 (Wrong number of parameters)
>
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.Single vs. double quotes matters:> SELECT Records.EventDesc, Records_Detail.EventDate, Records_Detail.FName,
> Records_Detail.LName, Records_Detail.RelayTeam, Records.Time_Mark,
> Records_Detail.Location
> FROM Records INNER JOIN Records_Detail ON Records.EventID =
> Records_Detail.EventID
> WHERE (((Records.EventID)=[records_detail].[eventid]) AND
> ((Records.Indoor_Outdoor)="o"))
> ORDER BY Records.EventID;
SELECT
Records.EventDesc,
Records_Detail.EventDate,
Records_Detail.FName,
Records_Detail.LName,
Records_Detail.RelayTeam,
Records.Time_Mark,
Records_Detail.Location
FROM
Records INNER JOIN Records_Detail
ON Records.EventID = Records_Detail.EventID
WHERE
Records.Indoor_Outdoor = 'o'
ORDER BY
Records.EventID
Jochem
--
Jochem van Dieten
Team Macromedia Volunteer for ColdFusion, beer and fun.
Jochem van Dieten - TMM Guest



Reply With Quote

