MobileMobile | Continue

Excel Bar

Excel Bar

Your excel questions will be responsed by our excel experts within 24hrs.Our service is free.

 Forgot Pass?
 Register Now
Find
Hot Search: Vlookup Match VBA
View: 278|Reply: 7

Data Type mismatch error while using Like in access query <

[Copy link]

5

Topics

21

Posts

67

Integral

Member

Rank: 2

Integral
67
Post on 1-22-2017 01:12:45 | All posts |Read mode
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]);
Reply

Props Report

5

Topics

21

Posts

67

Integral

Member

Rank: 2

Integral
67
 Author| Post on 1-23-2017 05:24:24 | All posts



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




Reply Support Opposition

Props Report

5

Topics

21

Posts

67

Integral

Member

Rank: 2

Integral
67
 Author| Post on 1-23-2017 06:34:16 | All posts



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

Props Report

3

Topics

561

Posts

1225

Integral

King

Rank: 6Rank: 6

Integral
1225
Post on 1-23-2017 16:56:39 | All posts



Hmm, you should not be able to combine tables like that...  Try:
SELECT Final.SRC_CIFAST, Final.QW, Final.Switch1, Final.Switch2, LTESITEID.LTEQW
FROM Final INNER JOIN LTESITEID ON [Final].[QW] = [LTESITEID].[LTEQW]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
Reply Support Opposition

Props Report

3

Topics

561

Posts

1225

Integral

King

Rank: 6Rank: 6

Integral
1225
Post on 1-26-2017 06:41:29 | All posts



Hmm, you should not be able to combine tables like that...  Try:
SELECT Final.SRC_CIFAST, Final.QW, Final.Switch1, Final.Switch2, LTESITEID.LTEQW
FROM Final INNER JOIN LTESITEID ON [Final].[QW] = [LTESITEID].[LTEQW]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












Reply Support Opposition

Props Report

5

Topics

21

Posts

67

Integral

Member

Rank: 2

Integral
67
 Author| Post on 1-26-2017 07:56:16 | All posts



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.
Reply Support Opposition

Props Report

5

Topics

21

Posts

67

Integral

Member

Rank: 2

Integral
67
 Author| Post on 1-26-2017 19:26:09 | All posts



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.




Reply Support Opposition

Props Report

6

Topics

732

Posts

1620

Integral

King

Rank: 6Rank: 6

Integral
1620
Post on 1-26-2017 19:48:38 | All posts



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 Support Opposition

Props Report

Points policy of this forum

Archiver|Mobile|Small dark house|Contact us|Excel Bar

GMT-5, 9-24-2017 21:29 , Processed in 0.226010 second(s), 20 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

!fastreply! Top !return_list!