Results 1 to 5 of 5
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Left Help

    I want to run a query where the left 3 of [lastName] (that is the field name) is not the same as [lastName]. I know this is the syntax for the Left function, but how do I do the not equal to portion?


    Code:
    L3: LEFT([lastName],3)

  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
    53,626
    That doesn't really make sense. What are you trying to do? Are you comparing values from two tables?
    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
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    No it is one table, but a few last names were input incorrectly. So what I was thinking was view lastName in one field (query field that is) then view lastName where the left3 is not the same. Was thinking (and it may not make sense) use string comparison to see where the typo's occured.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You would just use the following in the Criteria row (WHERE clause):
    Code:
    LEFT([lastName],3) <> [lastName]
    Really, in essence, all you are doing is returning all last names that are more than 3 characters long. You could also do that with:
    Code:
    LEN([lastName])>3

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    None of that will reveal misspelled names. Comparing a field to itself makes no sense. Need to compare with some master list and do a find unmatched query. Then it will be a case-by-case review to decide which is correct.
    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.

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

Similar Threads

  1. mid,left function
    By revned12 in forum Queries
    Replies: 2
    Last Post: 07-06-2012, 12:09 AM
  2. Verticle bar on the left
    By EinSpringfielder in forum Forms
    Replies: 5
    Last Post: 01-10-2012, 01:56 PM
  3. Left Join not
    By j_a_monk in forum Queries
    Replies: 5
    Last Post: 08-07-2011, 09:47 AM
  4. Replies: 3
    Last Post: 02-02-2011, 01:00 PM
  5. right-to-left report bug
    By papaworx in forum Access
    Replies: 6
    Last Post: 10-02-2010, 06:48 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