Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2007

Tip: Looking for answers? Try searching our database.

Query Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff G - 13 Nov 2007 17:13 GMT
Well here I go again. Biting off more than my brain can handle. I have a
report that shows all of our machines in our plant. I’m tracking both machine
down time (the time the machine is broken) and Plant Down Time (the time the
machine is broken that hampers production) I have a form that we use to
gather all pertinent information such as the date, time notified of
malfunction etc…

I have a query that well, queries the data so I can view what is happening
each month. That works great. Now to the meat and potatoes… I calculate down
times by using:
Minutes: DateDiff("n", [Time Notified], [Time Returned to Service])
In my query (Time Notified is when the machine goes down and Time Returned
to Service is when it’s working again), this works fine. In my report I
simply use =Sum([Minutes]) in a control box to get the total machine down
time.

A little back tracking now; on my form (the one that fills out the data in
my table) the technician uses a check box to signify if the machine down time
also results in “Plant Down Time”.

Now in my query everything for that month shows up. Let’s say I have 40
entries that result in 1,000 minutes of down time. But, 5 of those entries
resulted in Plant Down Time for a total of 100 minutes (5 check boxes are
checked in the table of the query).

How do I get those 5 Plant Down Time entries to show a Sum of 100 minutes in
my report?

The report should show something like this:

Total Machine Down Time for the Month:     1000

Total Plant Down Time for the Month:            100

But I don’t know how to make the query only sum the result of the 5 Plant
Down Time check boxes.

I can make another query to just show the 5 check boxes and there minute
results but I do not know how to make that query usable on my form that is
already based on the first query.

Any help would be greatly appreciated.

Signature

Jeff G
Maintenance Tech
Milgard Tempering

KARL DEWEY - 13 Nov 2007 17:41 GMT
Plant_Downtime: Sum(IIF([CheckBox]=-1, DateDiff("n", [Time Notified], [Time
Returned to Service]), 0))

Signature

KARL DEWEY
Build a little - Test a little

> Well here I go again. Biting off more than my brain can handle. I have a
> report that shows all of our machines in our plant. I’m tracking both machine
[quoted text clipped - 38 lines]
>
> Any help would be greatly appreciated.
John Spencer - 13 Nov 2007 17:46 GMT
Try this expression

  Sum(IIF([PlantDownTime]= True, [Minutes],Null))

Signature

John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.

> Well here I go again. Biting off more than my brain can handle. I have a
> report that shows all of our machines in our plant. I'm tracking both
[quoted text clipped - 43 lines]
>
> Any help would be greatly appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.