OS: XP Pro
Sorry if this is a bit long winded. First a little info about the database. This database is used to keep track of checkout information from our production department. It has three main tables that store information, the first one, that I have named "Checkout", stores the information I am querying for the two reports. It has six different fields - OrderNumber, Date, CheckedBy, BuiltBy, SerialNumber, and ComputerType. Using the following query, I pull information for a certain person and date range then group based on the date and computer type, count up the number of that computer type for that date and calculate the hours of work that translates to.
(Query 1)
Expand|Select|Wrap|Line Numbers
- SELECT Checkout.Date, Checkout.BuiltBy, Checkout.ComputerType,
- Count(Checkout.ComputerType) AS CountOfComputerType,
- IIf([ComputerType]="Desktop",[CountOfComputerType]*1,
- IIf([ComputerType]="Laptop",[CountOfComputerType]*0.5,
- IIf([ComputerType]="Server",[CountOfComputerType]*2,
- IIf([ComputerType]="MB Kit",[CountOfComputerType]/12)))) AS Hours
- FROM Checkout
- GROUP BY Checkout.Date, Checkout.BuiltBy, Checkout.ComputerType
- HAVING (((Checkout.Date) Between [Forms]![Production Report]![From Date] And [Forms]![Production Report]![To Date])
- AND ((Checkout.BuiltBy)=[Forms]![Production Report]![TechName]));
(Query 2)
Expand|Select|Wrap|Line Numbers
- SELECT Checkout.Date, Checkout.CheckedBy, Count(Checkout.CheckedBy) AS CountOfCheckedBy, [CountOfCheckedBy]/3 AS Hours
- FROM Checkout
- GROUP BY Checkout.Date, Checkout.CheckedBy
- HAVING (((Checkout.Date) Between [Forms]![Production Report]![From Date] And [Forms]![Production Report]![To Date])
- AND ((Checkout.CheckedBy)=[Forms]![Production Report]![TechName]));
Anybody have any thought?