Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    Houston, TX
    Posts
    116

    Unanswered: Does not include...aggregate function

    I am trying to create an access database to perform some calculation in a query but am getting a error. The formula is:
    IIf(#2/29/2004#<[Start Month],0,[Amount])+IIf(Sum([12/31/2003]+[1/31/2004])=[Term]*[Amount],-[Amount],0)

    The second if statement seems to be the problem. I've attached the db to see if someone can help me with this. I don't understand what the problem is that access won't allow.

    Thanks . . . texasalynn
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2003
    Posts
    21
    Your calculation for the field 2/29/2004 contains the word "sum", which is aggregate, (Total these fields down the whole query). You can't sum with a group by expression.

    Try removing the word "sum" from the field expression and see if you get the results you need.

    Gary

  3. #3
    Join Date
    Jun 2002
    Location
    Houston, TX
    Posts
    116
    Well that was easy. Is there a way to add multiple fields without listing each field individually? Because as my formulas go across the page I need to add all the fields together from start to field previously?

    Example:
    12/31/2003 to 2/29/2003 for the 3/31/2003 field
    12/31/2003 to 3/31/2003 for the 4/30/2003 field
    etc.

    texasalynn

Posting Permissions

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