Results 1 to 6 of 6
  1. #1
    deekadelic is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2016
    Posts
    23

    ISNUMERIC Function With Text Field

    I have a field with a TEXT data type, though most of the values in the field are composed entirely of numbers. I am trying to isolate these values with the ISNUMERIC function, so that I can edit them; but the function is coming up with no records.



    Am I missing something?
    Last edited by deekadelic; 07-19-2016 at 10:26 AM.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Not sure how you are using the function..... from Help:
    IsNumeric
    returns True if the entire expression is recognized as a number; otherwise, it returns False.

    IsNumeric("123 Front St.") = False
    IsNumeric("123.223") = True

  3. #3
    deekadelic is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2016
    Posts
    23
    I just noticed that for some reason, when I used the criterion of ISNUMERIC(BLAH) = "True", the numeric values produced FALSE in every record, but when I used ISNUMERIC(BLAH) = -1, they were all TRUE.

    Seems odd that Excel would be making that kind of distinction.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    "True" (in quotes) is a text string.

    So
    Code:
    ISNUMERIC(BLAH) = "True"
    (True in quotes) will always returns FALSE (0) because you are comparing a Boolean value to a text string. They will never be equal.



    In Excel, TRUE is defined (declared) as (equal to) 1
    In Access,TRUE is defined(declared) as (equal to) -1
    Only M$ knows why the difference in the TRUE values..

  5. #5
    deekadelic is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jun 2016
    Posts
    23
    That's what I was thinking, but for some reason Access adds the quotes around the word TRUE, and won't let me delete them.

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Look at "hours" in this grid. Hours is a text field and the isnumeric column works just as expected.
    The SQL view shows:
    Code:
    SELECT qVolTasks.IFIRST, qVolTasks.ILAST, qVolTasks.TaskDescription, qVolTasks.StartDate, qVolTasks.EndDate, qVolTasks.Hours
    FROM [qDBTCMAST ALPHA] INNER JOIN qVolTasks ON [qDBTCMAST ALPHA].TMID = qVolTasks.TMID
    WHERE (((IsNumeric([Hours]))=True));
    Attachment 25197
    Last edited by davegri; 07-19-2016 at 07:41 AM. Reason: added sql view

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

Similar Threads

  1. Nz() function not working in Access 2010 on Text field
    By cliff.clayman in forum Queries
    Replies: 8
    Last Post: 02-16-2021, 07:29 AM
  2. IsNumeric
    By vitordf in forum SQL Server
    Replies: 1
    Last Post: 10-08-2013, 06:01 AM
  3. Replies: 2
    Last Post: 03-30-2012, 07:39 AM
  4. Replies: 20
    Last Post: 09-06-2011, 12:39 PM
  5. IsNumeric
    By tcheck in forum Queries
    Replies: 4
    Last Post: 11-19-2010, 10:26 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