Results 1 to 4 of 4
  1. #1
    DavidK111 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    18

    Access isn't recognizing numbers after I run an update query to revise values in one column

    I feel like I came across this a long time ago, but I can't recall what the fix should be. The short of it is that Access doesn't seem to recognize the values in a table I am updating.

    I am using an update query to revise prices in a column Titled "Price". I am comparing the prices in the Price column to the prices in another column with a simple IIF statement (i.e., IIF([Price]=[Column2Price],"Yes","No"). However, oddly, the formula produces a "No" result, even when the prices are plainly the same values, and all formatting for both columns is the same. Whenever I manually type over the price with the same value, the formula works and Access seems to work as intended. For example, I simply type "12.95" over the same value that is displaying in the column that I updated that is already showing "12.95". Then, after I do that, the formula works and produces a "Yes" value.

    Is there anything that I may be doing wrong? Thanks for any suggestions.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Both field are number (Double) type? Don't set formatting in table, although that should not make any difference.

    Post the entire SQL statement of the UPDATE query.

    Why do you even need to compare the values? - just do the update. If the update is with the same value, nothing hurt.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    fundamentally one must realize that what the db stores and what it displays can be 2 different things; but the compare is literal on what it stores.... This is a feature - in that one does not want to always see all the digits of a fraction but can lead to the type confusion you describe. In addition if you are importing numbers from excel - the same scenario exists... so you see 1 in the excel...but it actually is 1.00001 and so fails the compare.

    both store & display can be manipulated at the table level, and then display can again be manipulated at the form level ; so what you really want to do is sanity check at the table level first as to what is really in the table.

  4. #4
    DavidK111 is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    18
    Excellent. Thanks for the reply. I discovered the source of the issue which was an import of a column that had improperly been labeled as text instead of number.

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

Similar Threads

  1. Replies: 5
    Last Post: 07-17-2014, 09:16 AM
  2. Replies: 4
    Last Post: 09-04-2013, 06:40 AM
  3. using macro to rename column values in Access
    By coolbear91 in forum Programming
    Replies: 1
    Last Post: 02-20-2013, 11:10 PM
  4. Replies: 15
    Last Post: 11-08-2012, 10:09 AM
  5. Replies: 5
    Last Post: 12-05-2011, 05:35 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