Results 1 to 5 of 5
  1. #1
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228

    Sum of field by criteria of other field

    hi all,

    i have a report in which i would like to display the quantity produced per shift depending on what size the part is.

    i have a field that says total leadbonded which is just a number. these parts are either size .04, .063, .125 and .250 of an inch.
    i would like to have the report footer display the total for each of these. there are times when the sum would be 0.



    right now i have this on my report in a text box: =IIf([cut_size]=0.125,Sum([total_leadbonded]),0)

    but it is giving me zero.

    any suggestions?

    thank you all in advance.
    jorge

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Try

    =Sum(IIf([cut_size]=0.125,[total_leadbonded],0))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228
    >.<
    thanks!

  4. #4
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228
    In a semi-related question:

    I'm using 4 text boxes under a footer to show this data, specifically, the Work Shift footer. this shows me what was done first, second and third shift.

    if i want the daily total, i will put it under report footer.

    My question: is it okay to copy and paste the same text boxes i used under W Shift footer in the report footer?
    does this violate any sort of db rules? consequences ?

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by mejia.j88 View Post
    does this violate any sort of db rules? consequences ?
    I hope not, because I do it all the time.

    Seriously, it's not uncommon to want something in both the group and report footers, to get group and overall totals. I see no problem with it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Criteria based on value in another field
    By karusya in forum Access
    Replies: 1
    Last Post: 04-03-2012, 01:46 PM
  2. This Week field criteria
    By scoughlan in forum Queries
    Replies: 4
    Last Post: 01-06-2012, 04:04 PM
  3. Different criteria for same field in same query
    By teirrah1995 in forum Queries
    Replies: 10
    Last Post: 08-12-2011, 01:03 PM
  4. Basing criteria on another Field
    By starhannes in forum Queries
    Replies: 3
    Last Post: 04-21-2010, 04:02 PM
  5. Replies: 4
    Last Post: 01-19-2010, 05:36 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