Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Query Prompt 1

Status
Not open for further replies.

Meso

Technical User
Sep 15, 2001
6
US
It seems I am missing something obvious in making this simple query work. I have a query that is going to take the whole number ratings given to a person based on their performance on a series of tests and then return the percentage of total possible points they accumulated. I have a second query that will run the first query, but will have a where parameter and prompt to ask the user to enter a cut off score - then returning only those scores above the cutoff.

Example:

Test_Table1
CandidateID: 1 Test1Score: 4 Test2Score:6
CandidateID: 2 Test1Score: 6 Test2Score:6
CandidateID: 3 Test1Score: 4 Test2Score:3
CandidateID: 4 Test1Score: 2 Test2Score:2

TestQuery1: Returns the percentage of total possible points the candidates received across the two test series - each test was worth 7 points each - 14 points for the series.

SELECT Test_Table1.ID, ([Test1]+[Test2])/14 AS Final_Score_Perecentage
FROM Test_Table1;
- This query returns:
CandidateID1: Final_Score_Percentage: 0.71
CandidateID2: Final_Score_Percentage: 0.86
CandidateID3: Final_Score_Percentage: 0.50
CandidateID4: Final_Score_Percentage: 0.43

Second Query to enter a cut off score and return records of .70 or higher:
QueryTest2:
SELECT TestQuery1.Final_Score_Perecentage
FROM TestQuery1
WHERE (((TestQuery1.Final_Score_Perecentage)>[Cut off Score]))
GROUP BY TestQuery1.Final_Score_Perecentage;

Entering .70 on this query returns all records, where I only want the records with scores above .70 to return.

QueryTest3:This query will return only Candidate 1 and 2's scores:

SELECT TestQuery1.Final_Score_Perecentage
FROM TestQuery1
WHERE (((TestQuery1.Final_Score_Perecentage)>0.7))
GROUP BY TestQuery1.Final_Score_Perecentage;

Like I said, it's probably something simple I'm missing here, but would like to get the query with the prompt to work. Appreciate any responses....thanks....B.
 
maybe:
Code:
SELECT TestQuery1.Final_Score_Perecentage
FROM TestQuery1
WHERE (((TestQuery1.Final_Score_Perecentage)>VAL([Cut off Score])))
GROUP BY TestQuery1.Final_Score_Perecentage;

Leslie

In an open world there's no need for windows and gates
 
Leslie,

That was it, I really do appreciate the quick response. Thanks...Bart
 
Why not simply a single query ?
Code:
SELECT Test_Table1.ID, ([Test1]+[Test2])/14 AS Final_Score_Perecentage
FROM Test_Table1
WHERE ([Test1]+[Test2])>14*[Cut off Score]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I figured there was a way to do it in a single query, but it was too early in the morning to try and figure it all out...

Les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top