Data Type mismatch error while using Like in access query

teco1

New Member
Joined
May 9, 2016
Messages
10
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]);
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
LIKE
works on strings

you might try
cstr( cdbl( [Final.QW] ) ) Like '*' & cstr( cdbl( [LTESITEID.LTEQW] ) ) & '*'
 
Upvote 0
LIKE
works on strings

you might try
cstr( cdbl( [Final.QW] ) ) Like '*' & cstr( cdbl( [LTESITEID.LTEQW] ) ) & '*'


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

Thanks
 
Upvote 0
If you are checking for them to be the same, then use = instead of LIKE.

Also, why is there no join field between these two tables?

It might be helpful if you can tell us exactly what it is you are trying to accomplish, and maybe post some small samples of what the data looks like.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,980
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top