Results 1 to 7 of 7
  1. #1
    rjk1080 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    6

    Question Easy Custom Calculation?

    Expr1: (300-(sum[total purchase]))

    get error: there could be an operand without operator




    What am I doing wrong here?

    If I go this route:

    sum(300-[total purchase])

    the query comes out wrong. The table is a transaction table. A customer can have more than one transaction. Problem is, with the expression above, if a specific customer has two transactions, the expression will take 300x2=600 - total purchase. 3 transactions will use 900, and so on.

    I feel like the expression at the top makes more sense were it not for the error message.

    I know this is probably basic stuff. Would appreciate any help. Thanks.

  2. #2
    rjk1080 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    6

    also

    I forgot to add that customers are credited $300 to begin with.

    This query is supposed to track their remaining balances

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Use the Query Builder to create your agregrate query first without the special calculation. Pressing the Sigma character in the toolbar changes a select query to an agregrate query. Once you get the Sum() working then add your special calculation field.

  4. #4
    rjk1080 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    6
    The query is set up as an aggregate. The second field is "Total Purchase." In the total row, I selected sum. This works correctly. It sums a customers total purchases. The special calculation is what is not working. I am trying to get it to take 300 minus the total purchase amount the query comes up with in the second column.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try:
    Expr1: 300-(sum([total purchase]))

  6. #6
    rjk1080 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    6

    Worked!!

    It worked! Thank you very much RG.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Thanks for marking the thread as Solved as well.

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

Similar Threads

  1. databasing CDs, sounds easy right?
    By RAGEFEAR in forum Access
    Replies: 8
    Last Post: 06-02-2009, 04:15 PM
  2. Custom Import Tool
    By naoumaro in forum Import/Export Data
    Replies: 0
    Last Post: 04-10-2009, 08:30 PM
  3. cmd button probs- easy fix..help
    By burgicide in forum Forms
    Replies: 4
    Last Post: 11-20-2008, 03:28 PM
  4. Easy question...so why can't I figure it out?
    By bdrago527 in forum Access
    Replies: 1
    Last Post: 10-02-2008, 02:40 PM
  5. easy checkbox question
    By nelsok in forum Forms
    Replies: 1
    Last Post: 06-09-2006, 05:46 PM

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