Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Location
    ny, ny
    Posts
    224

    Unanswered: calculations in a query

    SELECT WorkOrders.AssetNo, Sum(WorkOrders.Downtime) AS TotalDowntime, FROM WorkOrders
    WHERE (((WorkOrders.DateReceived) Between [Forms]![SelectDate]![BeginningDate] And [Forms]![SelectDate]![EndingDate]))
    GROUP BY WorkOrders.AssetNo

    the above finds the total downtime for every asset no between a certain time period
    I need to add another field and it is the quotient of total downtime by the no of days

    any ideas .. have been struggling with this for a long time now

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    SELECT WorkOrders.AssetNo, Sum(WorkOrders.Downtime) AS TotalDowntime, Sum(WorkOrders.Downtime) / (datediff("d", [Forms]![SelectDate]![BeginningDate], [Forms]![SelectDate]![EndingDate]))) AS quotient.
    FROM WorkOrders
    WHERE (((WorkOrders.DateReceived) Between [Forms]![SelectDate]![BeginningDate] And [Forms]![SelectDate]![EndingDate]))
    GROUP BY WorkOrders.AssetNo

    something like that?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •