Results 1 to 5 of 5
  1. #1
    g4b3TehDalek is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Earth....for now
    Posts
    14

    Unhappy Add operator not working as expected

    Hello AF ,

    Not quite sure what's going on with this. I'm trying to add several fields together in a query but instead of getting a sum I'm getting a huge number consisting of combined values.

    For example, when I add:
    57,569 + 500 + 1,000 + 500 + 3,200 + 7,157 + 3,700 + 1,000 + 10,881

    I get:
    575,695,001,000,500,320,071,573,700,100,010,881

    And the expression I'm using is:


    Annual: FormatNumber([BaseSalary]+[BCLADReturn]+[MAReturn]+[RSPReturn]+[OtherStipend]+[AcaCoach]+[Sierra]+[LongevityStipend]+[HealthCostsReturn],0)

    I've run into this problem before on a form I created for this same database, but luckily the problem resolved itself that time. Not so fortunate this time around.

    I'm not sure if this is contributing to the problem, but all of the fields (except one) I'm adding are calculated. I've even excluded the non-calculated field and get the same result.

    Help plzzz

  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,641
    The values are being seen as text rather than numbers, either due to their data type in the table or as the result of a function being applied during the calculation (IIf, Nz, etc). You can try wrapping each in the appropriate conversion function (CLng, CCur, etc).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    g4b3TehDalek is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Earth....for now
    Posts
    14
    Thx Paul. I kinda suspected that but wasn't sure how to approach it. I'll punch in some conversions and cross my fingers

  4. #4
    g4b3TehDalek is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    Earth....for now
    Posts
    14

    Thumbs up pbaldy iz 1337!!1!11!!1

    I'd like to hereby nominate pbaldy for the Nobel Prize!

    It worked perfectly Paul. As ur suggestions always seem to.

    Thx a million.

  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,641
    LOL! Happy to help.
    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. 3061 Error. Too few parameters. Expected 1.
    By rghollenbeck in forum Queries
    Replies: 5
    Last Post: 09-28-2011, 12:12 PM
  2. Relationships not working as expected
    By Poepol in forum Access
    Replies: 1
    Last Post: 04-29-2011, 05:39 AM
  3. Too few parameters expected 4
    By forestgump in forum Programming
    Replies: 1
    Last Post: 04-15-2011, 09:10 AM
  4. Recordset not behaving as expected
    By jgelpi16 in forum Programming
    Replies: 4
    Last Post: 02-15-2011, 04:25 PM
  5. Too few parameters. Expected 2.
    By PPCMIS2009 in forum Access
    Replies: 0
    Last Post: 01-28-2009, 01:02 PM

Tags for this Thread

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