+ Reply to Thread
Results 1 to 6 of 6

Data Type mismatch error while using Like in access query

  1. #1
    Registered User
    Join Date
    05-09-2016
    Location
    uae
    MS-Off Ver
    2010
    Posts
    21

    Data Type mismatch error while using Like in access query

    Dear All

    Need your support. I am getting Data type mismatch error while using Like in access query.
    Below is my query and i have converted Final.QW and LTESITEID.LTEQW to Value by using VAL() Function to remove preceding zeros from them.



    SELECT Final.SRC_CIFAST, Final.QW, Final.Switch1, Final.Switch2, LTESITEID.LTEQW
    FROM Final, LTESITEID
    WHERE ( [Final.QW] Like [LTESITEID.LTEQW]);

  2. #2
    Registered User
    Join Date
    05-09-2016
    Location
    uae
    MS-Off Ver
    2010
    Posts
    21

    Re: Data Type mismatch error while using Like in access query

    Is there any other way to display the results where Both LTESITEID.LTEQW and Final.QW are same.

    Thanks

  3. #3
    Registered User
    Join Date
    05-09-2016
    Location
    uae
    MS-Off Ver
    2010
    Posts
    21

    Re: Data Type mismatch error while using Like in access query

    Is there any other way to display the results where Both LTESITEID.LTEQW and Final.QW are same.

    Thanks

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    3,274

    Re: Data Type mismatch error while using Like in access query

    Hmm, you should not be able to combine tables like that... Try:

    Please Login or Register  to view this content.
    Note that square brackets don't go around tablename.fieldname but around tablename AND around fieldname
    If syntax wasn't the reason for the issue then maybe it truly is a data type problem, but you'd have to tell me what data types Final.QW and LTESITEID.LTEQW are
    Last edited by Arkadi; 01-23-2017 at 12:19 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  5. #5
    Registered User
    Join Date
    05-09-2016
    Location
    uae
    MS-Off Ver
    2010
    Posts
    21

    Re: Data Type mismatch error while using Like in access query

    Thanks for your support. Actually the issue was with the original excel sheet which i was using as an input.
    I changed its Column type to General and now its not showing Data Type Mismatch Error.

  6. #6
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    11,752

    Re: Data Type mismatch error while using Like in access query

    Like is not exact, you need to use a special character with it. Most DB use %
    For example
    WHERE YourName LIKE 't%';

    WHERE ( [Final.QW] Like [LTESITEID.LTEQW%]);

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1