Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2010
    Posts
    8

    Filtering using IsNumeric and Left functions

    This should be easy - but I'm getting nowhere.



    I have a text field called ISBN in a table. I want to query on the table, listing only those records in which the ISBN number starts out with a numeric digit. I thought that would be achievable with the following criteria in the ISBN column:

    IsNumeric(Left([ISBN],1))

    but the query comes back with NOTHING.

    If I take the opposite tack to list just ISBN'S starting alpha -

    Not IsNumeric(Left([ISBN],1))

    I get back EVERYTHING (both alpha and numeric-beginning ISBN's).

    What am I doing wrong?

    Thanks!

  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,652
    I just tested this and it worked as expected:

    WHERE IsNumeric(Left(PuStreet, 1))

    Are you sure your field doesn't have a leading space or something?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Have you tried making a separate field as an alias such as NumericEval:IsNumeric(Left([ISBN],1)) and then in the criteria for that field have -1. That should only show the ISBNs that start with a numeric value.

    Dan
    Access Development

  4. #4
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Have you tried making a separate field as an alias such as NumericEval:IsNumeric(Left([ISBN],1)) and then in the criteria for that field have -1. That should only show the ISBNs that start with a numeric value.

    Dan
    Access Development

    Quote Originally Posted by Kevin Johnston View Post
    This should be easy - but I'm getting nowhere.

    I have a text field called ISBN in a table. I want to query on the table, listing only those records in which the ISBN number starts out with a numeric digit. I thought that would be achievable with the following criteria in the ISBN column:

    IsNumeric(Left([ISBN],1))

    but the query comes back with NOTHING.

    If I take the opposite tack to list just ISBN'S starting alpha -

    Not IsNumeric(Left([ISBN],1))

    I get back EVERYTHING (both alpha and numeric-beginning ISBN's).

    What am I doing wrong?

    Thanks!

  5. #5
    Join Date
    Apr 2010
    Posts
    8
    Paul,

    No, I don't have any leading zeroes.

    Dan,

    Your solution worked just fine! And if I substitute in NumericEval:Not IsNumeric(Left([ISBN],1)), it returns just the alpha-beginning numbers.

    Any idea why the approach I was first taking didn't work? Not that it really matters since I have a working solution now.

    Thanks!

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

Similar Threads

  1. Problem with Left Join & VB6
    By msrdjan1 in forum Queries
    Replies: 0
    Last Post: 03-30-2010, 01:48 AM
  2. upper left button
    By julienb in forum Forms
    Replies: 0
    Last Post: 03-02-2010, 07:55 AM
  3. Update with LEFT JOIN
    By mcarthey in forum Access
    Replies: 1
    Last Post: 08-27-2008, 10:49 AM
  4. Examples of left joins?
    By narayanis in forum Queries
    Replies: 0
    Last Post: 06-14-2008, 06:17 AM
  5. Left function with various lenth of digits
    By mohsin74 in forum Queries
    Replies: 0
    Last Post: 07-10-2007, 02:00 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