Input box?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
When I run this query it launches an input bax asking for the value of
Actual Hours. The query works if you press ok without entering any
information. Is this just Access being strange or am I doing something wrong
with the query design. Below is the code.

SELECT PN_Number.PN_Number, PN_Number.Estimated_Time, Sum([Time
Records].Hours) AS [Actual Hours], PN_Number.Project_Competed, [Actual
Hours]-[Estimated_Time] AS [Hour Difference]
FROM PN_Number INNER JOIN [Time Records] ON PN_Number.PN_Number = [Time
Records].PN_number
GROUP BY PN_Number.PN_Number, PN_Number.Estimated_Time,
PN_Number.Project_Competed, [Actual Hours]-[Estimated_Time]
HAVING (((PN_Number.Estimated_Time) Is Not Null) AND
((PN_Number.Project_Competed)=True));


Thanks
 
I never use a calculated "alias" in another calculation.
SELECT PN_Number.PN_Number, PN_Number.Estimated_Time,
Sum([Time Records].Hours) AS [Actual Hours], PN_Number.Project_Competed,
Sum([Time Records].Hours)-[Estimated_Time] AS [Hour Difference]
FROM PN_Number INNER JOIN [Time Records]
ON PN_Number.PN_Number = [Time Records].PN_number
GROUP BY PN_Number.PN_Number, PN_Number.Estimated_Time,
PN_Number.Project_Competed, Sum([Time Records].Hours)-[Estimated_Time]
HAVING (((PN_Number.Estimated_Time) Is Not Null) AND
((PN_Number.Project_Competed)=True));
 
Thanks for your help but the code has a join error when i tried to use it.

I also tried using the original [hours] value in the query instead of
[actual hours] and it repeated records lots of times. Any ideas?
Thanks
 
Back
Top