Results 1 to 5 of 5
  1. #1
    Huddle is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    318

    Formula for counting shifts

    I'm having trouble getting the correct answer for a formula that counts the total number of shifts for a FSL.



    The answer for FSL 0 should be 22; The answer for FSL 1 should be 36.

    The formulas I've tried are:

    =Sum(IIf([FSL]=0,[Shifts]))
    =Sum(IIf([FSL]=1,[Shifts]))

    =count(IIf([FSL]=0,[Shifts]))
    =count(IIf([FSL]=1,[Shifts]))

    The attached example shows multiples but I just threw it together to show what I was doing.
    Attached Files Attached Files

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    The information in the header of your post says that you are using A2003 but the file you have attached is created with a later version. If you can post a mdb version you may get more response. Some of us are still using A2003.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

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

  4. #4
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    OK. I want to make it even more of a headache. I've redid the example and attached it.

    I'd like for the user to enter in the weekending date and the formula to pull up only those items equal to or before the entered date.

    I don't even know where to start with the formula.
    Attached Files Attached Files

  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
    I'm running out the door so haven't looked at the sample, but this type of thing:

    =Sum(IIf([FSL]=0 AND DateField <= Forms!FormName.TextboxName,[Shifts],0))

    which assumes you're using a form for the date.
    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. Formula field
    By vidplaylist in forum Queries
    Replies: 3
    Last Post: 12-06-2011, 03:45 PM
  2. Formula mod help
    By jcaptchaos2 in forum Access
    Replies: 2
    Last Post: 04-25-2011, 02:55 PM
  3. SQL Formula to Sum Itself
    By Scorpio11 in forum Access
    Replies: 1
    Last Post: 02-19-2011, 11:22 AM
  4. Formula
    By hschrunk in forum Access
    Replies: 3
    Last Post: 05-18-2010, 01:40 PM
  5. Help with formula for Query
    By goldie6175 in forum Queries
    Replies: 1
    Last Post: 02-18-2010, 11:29 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