If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Why am I asked to enter parameter value?
My query calculates the percent of hours worked on a project compared
to total hours worked. Here are the relevant fields: Field: HoursWorked Table: MainProjectTable Total: Sum Field: SumofHoursWorked Table: qryTtlHrs Field:Percent: [SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked When I run the query I'm asked to enter parameter value for [SumOfHoursWorked1] even though the criteria row is empty for all of these fields. I hit OK and the query runs perfectly. How do I get rid of the Enter Parameter Message Box? Any help would be much appreciated. Thanks in advance. -JZ |
#2
|
|||
|
|||
Why am I asked to enter parameter value?
It is prompting for that because you did not tell it where to find the data --
Field:Percent: [SumOfHoursWorked1] /qryTtlHrs!SumOfHoursWorked "JZ" wrote: My query calculates the percent of hours worked on a project compared to total hours worked. Here are the relevant fields: Field: HoursWorked Table: MainProjectTable Total: Sum Field: SumofHoursWorked Table: qryTtlHrs Field:Percent: [SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked When I run the query I'm asked to enter parameter value for [SumOfHoursWorked1] even though the criteria row is empty for all of these fields. I hit OK and the query runs perfectly. How do I get rid of the Enter Parameter Message Box? Any help would be much appreciated. Thanks in advance. -JZ |
#3
|
|||
|
|||
Why am I asked to enter parameter value?
Thanks for the response Karl. I built Percent:
[SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked in the expression builder. Access added the 1 at the end of [SumOfHoursWorked1] because I am dividing two different sums of the same HoursWorked field. I tried [qryPrcnt]![SumOfHoursWorked] /[qryTtlHrs]![SumOfHoursWorked], where qryPrcnt is the query I'm working on, but that did not work. Any suggestions on what to try next? -JZ |
#4
|
|||
|
|||
Why am I asked to enter parameter value?
Percent is actual divided by possible. Unless you use a subquery you will
not have the possible to divide unto the actual. You can use a totals query to get the possible or assume a fixed number for the possible like 8 hours per day. "JZ" wrote: Thanks for the response Karl. I built Percent: [SumOfHoursWorked1]/qryTtlHrs!SumOfHoursWorked in the expression builder. Access added the 1 at the end of [SumOfHoursWorked1] because I am dividing two different sums of the same HoursWorked field. I tried [qryPrcnt]![SumOfHoursWorked] /[qryTtlHrs]![SumOfHoursWorked], where qryPrcnt is the query I'm working on, but that did not work. Any suggestions on what to try next? -JZ |
#5
|
|||
|
|||
Why am I asked to enter parameter value?
Sorry Karl, but I'm a little confused. I'm already using a sub query,
"qryTtlHrs", to calculate the denominator of the Percent expression. -JZ |
#6
|
|||
|
|||
Why am I asked to enter parameter value?
Post your SQL statement - open query in design view, click on menu VIEW - SQL
View. Hightlight, copy, and paste in a post. "JZ" wrote: Sorry Karl, but I'm a little confused. I'm already using a sub query, "qryTtlHrs", to calculate the denominator of the Percent expression. -JZ |
#7
|
|||
|
|||
Why am I asked to enter parameter value?
SELECT DISTINCTROW ProjectList.[Primary Key],
MainProjectTable.ProjectID, ProjectList.AssignedEngineer, Sum(MainProjectTable.HoursWorked) AS SumOfHoursWorked1, qryTtlHrs.SumOfHoursWorked, [SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked] AS [Percent] FROM (qryTtlHrs INNER JOIN ProjectList ON qryTtlHrs.EmployeeName = ProjectList.AssignedEngineer) INNER JOIN MainProjectTable ON ProjectList.[Primary Key] = MainProjectTable.ProjectID GROUP BY ProjectList.[Primary Key], MainProjectTable.ProjectID, ProjectList.AssignedEngineer, qryTtlHrs.SumOfHoursWorked, [SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked], MainProjectTable.EmployeeName HAVING (((MainProjectTable.EmployeeName)=[AssignedEngineer])); -JZ |
#8
|
|||
|
|||
Why am I asked to enter parameter value?
I am not up to snuff on subqueries but I do see where [SumOfHoursWorked1]
comes from. I would recommend you building a separate query if someone can not help with the subquery. "JZ" wrote: SELECT DISTINCTROW ProjectList.[Primary Key], MainProjectTable.ProjectID, ProjectList.AssignedEngineer, Sum(MainProjectTable.HoursWorked) AS SumOfHoursWorked1, qryTtlHrs.SumOfHoursWorked, [SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked] AS [Percent] FROM (qryTtlHrs INNER JOIN ProjectList ON qryTtlHrs.EmployeeName = ProjectList.AssignedEngineer) INNER JOIN MainProjectTable ON ProjectList.[Primary Key] = MainProjectTable.ProjectID GROUP BY ProjectList.[Primary Key], MainProjectTable.ProjectID, ProjectList.AssignedEngineer, qryTtlHrs.SumOfHoursWorked, [SumOfHoursWorked1]/[qryTtlHrs]![SumOfHoursWorked], MainProjectTable.EmployeeName HAVING (((MainProjectTable.EmployeeName)=[AssignedEngineer])); -JZ |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
'Enter Parameter Value' dialog wrongly appearing in Access 2000 | Darren Burns | Setting Up & Running Reports | 5 | November 30th, 2005 12:52 PM |
enter parameter value | Question | Running & Setting Up Queries | 3 | August 11th, 2005 09:58 PM |
Enter parameter value | John | New Users | 1 | February 8th, 2005 02:22 AM |
Unwanted enter parameter value | TLuebke | Setting Up & Running Reports | 2 | January 25th, 2005 05:09 PM |
How do I print the details view | David | Running & Setting Up Queries | 5 | August 28th, 2004 12:17 AM |