• Need help with a query (Access 97)

    Author
    Topic
    #405450

    This is a sample of a db that is used to track operator/machine utilization and productivity. Aquired new machines (APS) in March that now take 2 people to operate. From March until now, only one entry is made for each APS machine per shift/day. So we really aren’t tracking the productivity of the 2nd person that it takes to run an APS machine.

    Is there a way to create a query that can take any entries with an EndDate >= 06/01/2004, where the MachineName is like *APS*, and take the RunTime and divide that number by 2 (because we will now have an entry for each associate). But at the same time, perform no calculation for entries prior to 06/01/04 and no calculations on machinenames that are not APS machines.

    Confusing, but I hope that you can help.

    Thanks,

    Marie

    Viewing 2 reply threads
    Author
    Replies
    • #833026

      What about using a calculated field:

      IIf([EndDate}>=#06/01/2004# and Left([MachineName],3)=”APS”,[RunTime]/2,[RunTime]

      Tom

    • #833069

      Tom’s expression (with a bracket corrected and a parenthesis added) should do what you want:

      IIf([EndDate]>=#6/1/2004# And Left([MachineName],3)=”APS”,[RunTime]/2,[RunTime])

      as should this one, that avoids IIf:

      [Runtime]/(1-([EndDate]>=#6/1/2004# And [MachineName] Like “*APS*”))

    • #833070

      Tom’s expression (with a bracket corrected and a parenthesis added) should do what you want:

      IIf([EndDate]>=#6/1/2004# And Left([MachineName],3)=”APS”,[RunTime]/2,[RunTime])

      as should this one, that avoids IIf:

      [Runtime]/(1-([EndDate]>=#6/1/2004# And [MachineName] Like “*APS*”))

    Viewing 2 reply threads
    Reply To: Need help with a query (Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: