Results 1 to 11 of 11
  1. #1
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199

    How to correct #Num! errors in a query

    Hello,

    I'm using CInt to convert text data to integer in one of my queries, however the result is populating all rows with #Num! and #Error errors. Does anyone have any idea why and more important how to fix?



    thanks,

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you certain all of the source entries are Integers, -32,768 to 32,767?

  3. #3
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Hello RuralGuy, actually the data I'm converting into integers using CInt is Text. However it all looks like integers, i.e. 12345. It's between that range you cited as well.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Are you sure THESE are numbers, and not words? That will do it.

  5. #5
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    ranman256, yes they're all numbers. I take back one thing I said though, these numbers tend to range higher than the 32,767. For example, 433373.0, being one example. Could that be the problem?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try CLng() which covers -2,147,483,648 to 2,147,483,647

  7. #7
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    yes. use LONG.

  8. #8
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Ruralguy and ranman, thank you . CLng took care of half the errors. Any idea how to remove #Error which I think is being thrown because some rows are Null. Thanks!

  9. #9
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Answering my own question but I bet it's Nz right!?

  10. #10
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Possible. Usu nulls produce null, unless a fucntion is applied. so possible.

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Nz() is exactly the right function to use.

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

Similar Threads

  1. Replies: 5
    Last Post: 09-12-2014, 06:41 AM
  2. Replies: 4
    Last Post: 06-21-2014, 05:43 AM
  3. Query by form errors
    By cfljanet in forum Access
    Replies: 9
    Last Post: 09-25-2013, 11:17 AM
  4. Replies: 10
    Last Post: 07-25-2011, 12:07 PM
  5. Replies: 9
    Last Post: 06-26-2011, 09:14 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