Results 1 to 5 of 5
  1. #1
    hikerdood is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    44

    Report Using =sum(iif([Exp Hours]>0,))

    Trying to sum only positive values in Report field [Exp Hours] but get zero as a result.



    If I use =sum([Exp Hours]) is works but nets the hours.

    I did some research and used the formula in the title.

    Any help is appreciated.

    Regards

    Hikerdood

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    in the query ,put the critiera: [Exp Hours]>0
    then in the report (or other query) SUM

  3. #3
    hikerdood is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    44
    ranman,

    Sincerely apologize for using the wrong field for summation. I should have used the [Bal Hrs] field when trying to sum. The [Bal Hours] takes the [Issued Hrs] less the [Exp Hours] and it is the [Bal Hours] I want to sum. We have a culture of sometimes overcharging Job Orders and we want to show not only positive balances remaining for each open individual Job Order record but also show the Departments each open individual Job Order record that has a negative in [Bal Hours].

    What I am attempting to do is get a total [Bal Hours] at the group and footer level for only those open Job Orders with a positive balance and not sum the net hours with the inclusion of negative hours. Hope I am making sense. This is what I thought would work in the reports [Unbound] text box at the footer level but it doesn't. I got this format from a search.



    =sum(iif([Bal Hours]>0,0))



    Regards

    hikerdood

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    I might try DSum with criteria. Not sure if the domain has to be a table or query, or if you can refer to your report field and that would be based on it's recordset.
    Or you can post a db copy. I often muddle my way through the complexities of report requests but extracting that from my old noodle hurts too much!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Bullschmidt's Avatar
    Bullschmidt is offline Freelance DB Developer
    Windows 10 Office 365
    Join Date
    Mar 2020
    Location
    USA
    Posts
    64
    What I am attempting to do is get a total [Bal Hours] at the group and footer level for only those open Job Orders with a positive balance and not sum the net hours with the inclusion of negative hours. Hope I am making sense. This is what I thought would work in the reports [Unbound] text box at the footer level but it doesn't. I got this format from a search.

    =sum(iif([Bal Hours]>0,0))
    Try correcting the above to be this instead (I just tested with something similar and worked for me):
    =sum(iif([Bal Hours]>0,[Bal Hours],0))

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 23
    Last Post: 03-07-2020, 07:32 AM
  2. Replies: 5
    Last Post: 08-30-2015, 05:17 AM
  3. Subtract 8 hours of work from result hours
    By alhareri in forum Queries
    Replies: 6
    Last Post: 12-02-2014, 08:25 AM
  4. Replies: 1
    Last Post: 08-08-2012, 01:42 PM
  5. Replies: 4
    Last Post: 08-06-2012, 10:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums