Pull data for report from 2 queries

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

I'm not even sure I'm doing this right, or the best way. Any help would be
appreciated.
I have a table created for tracking downtime, among other things, for
equipment. We have preventitive maintance done on the equipment once a month
and time is also tracked in the original table.
When I go to generate a report, I can't have the PM time show up as actual
downtime on the machine and I have a query which pulls this out. However I
need to show the hours of the PM's for each machine on the same report. I
also have a simple query which finds these.
When I go to build the report, I can get the downtime to show up properly
for each machine, the PM time however isn't working. I have a text box on the
report looking to the PM query however a "Enter Parameter Value" box pops up,
not sure why or what it's looking for. When the report generates, I simply
get errors in the column of the report where it's looking for this data.
What I need is for the correct PM time to show up for the associated
machine, without the number being added to the downtime. Is this possible?
 
You should have two tables, Equipment and Maintenance, with a one-to-many
relationship.
The Maintenance table should be like this --
MaintID - autonumber - primary key
EquipID - long integer - foreign key
MaintStart - DateTime
MaintEnd - Datetime
MaintType - text - P-PM, C-Corrective, O-Other
OutOfSvc - Yes/No

Some corrective and PMs can be performed without downtime or out of service.

You query can sum date difference of MaintStart and MaintEnd if MaintType
equals 'P' and OutOfSvc -- and --sum date difference of MaintStart and
MaintEnd if MaintType equals 'C' and OutOfSvc.
 
Back
Top