Results 1 to 6 of 6
  1. #1
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368

    confusing datatype error issue

    Hi all.


    I am getting a datatype mismatch error in my criteria section yet cant find out why. everything is a text datatype. What am I missing? Some fresh eyes may catch what I've missed.

    WHERE
    tblIIDorig.[Last name] = Right([tblIIDwork].[*Customer Name],Len([tblIIDorig].[Last name]))
    AND
    tblIIDorig.[First name] = Left([tblIIDwork].[*Customer Name],Len([tblIIDorig].[First name]))

    and yes I know the field names are horrible, not much I can do about it. 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,521
    Are there any Null values in either field?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    i believe so. however, dont nulls have a len(0)? would that be a problem?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I think it will return Null, which is why a common test is

    Len(Value & "")

    which will make it return 0. I'd probably wrap each of them in the Nz() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Nz around the Len worked well. ty sir.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problemo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Criteria Issue
    By RichardS in forum Queries
    Replies: 3
    Last Post: 09-16-2010, 09:19 PM
  2. Combobox issue
    By maluna in forum Access
    Replies: 8
    Last Post: 09-08-2010, 01:01 AM
  3. new issue...graphs
    By thewabit in forum Forms
    Replies: 3
    Last Post: 02-01-2010, 05:19 AM
  4. If statement Issue????
    By graviz in forum Programming
    Replies: 1
    Last Post: 09-25-2009, 10:09 AM
  5. Keep together issue (Access 12)
    By alpha in forum Reports
    Replies: 2
    Last Post: 06-02-2009, 08:21 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