Results 1 to 6 of 6
  1. #1
    skrobe2 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    3

    Why does my calculation work for everything except when dealling with numbers < 1

    Am building an Access 2016 db for personal use for my husband's and my credit card and checking account expenses. So far, it works as expected for everything except one specific kind of instance.

    I have worked with relational db's quite a bit, but not access, so I am a bit new to this.

    I have a calculated field where the result type is currency and the format is currency. My calculation is this: IIf([Full Amt]*[Div Amt] And IsNull([Sandy Amt]),[Full Amt]*[Div Amt],[Sandy Amt]).

    I have a situation where the Div Amt = 0.50, and my Full Amt = .33. I get no results from my calculation. Since all the other instances in my table have all involved numbers where Full Amt is greater than 1.00, I am sure that the problem is that .33 is less that 1.00. However, I am not making any sense as to why this is a problem.



    I must have defined something incorrectly, but am not sure what nor what it should be defined as.

    Thank you for your input. Feeling a bit silly now...

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You should really do calculations in Queries and not have calculated values in fields.

  3. #3
    skrobe2 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    3
    So if I put this calculation into a query, would that also resolve my issue?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Probably not but at least you would not have a potential bogus value in your table. Have you tried displaying all of the values with a Debug.Print? You are probably dealing with a Null value that Nz() could probably resolve.

  5. #5
    skrobe2 is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2016
    Posts
    3
    Thank you for your reply. As it turns out, my husband wants us to use Excel, and so we are going that direction. I liked Access because of the ease of querying reports; but it really does not do exactly what we need. So we have moved in a different direction for this project.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That's fine. If you ever change your mind just start a new post. I'll mark this as Solved for now.

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

Similar Threads

  1. Simple calculation won't work
    By wcrimi in forum Queries
    Replies: 5
    Last Post: 11-27-2015, 03:47 PM
  2. Replies: 5
    Last Post: 06-09-2015, 08:45 PM
  3. Replies: 8
    Last Post: 03-10-2014, 11:47 AM
  4. Replies: 1
    Last Post: 06-13-2012, 07:39 PM
  5. Replies: 1
    Last Post: 11-29-2011, 08:43 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