Type Mismatch

DonnyF

Board Regular
Joined
Apr 25, 2017
Messages
76
Hello,

I am trying to filter out one particular customer in a query and get the error type mismatch.

In my criteria row for 'CompanyName' I put:

<>"Astro Racing"

What am I doing wrong?

Thank you for the help,
Donny
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Do you have any erroneous entries in this field in any of the records?
 
Upvote 0
I don't think so. When I search with this query without the criteria it lists all companies fine. The problem comes up when I try to filter out the one company.
 
Last edited:
Upvote 0
Try sorting by that field, and take a look at the first and last records for any oddities.
Is the field of Text data type?
Can you post the full SQL code for the query (switch the query to SQL View and copy and paste the code here)?
 
Upvote 0
SQL view:

SELECT Workorder.ReceivedDate, Workorder.PartNumber, Workorder.SerialNumber, Workorder.AFRNumber, Workorder.CompanyName
FROM Workorder
WHERE (((Workorder.CompanyName)<>"The Gadget-Place") AND ((Workorder.CloseWorkOrder)=False))
ORDER BY Workorder.CompanyName;
 
Upvote 0
I see you have two criteria expressions in there.
If you remove the CompanyName one and leave the CloseWorkOrder one, does it work?

Also, the CompanyName field is not a lookup field, is it?
 
Upvote 0
try


Code:
select distinct 
  Workorder.CompanyName, 
  Workorder.CloseWorkOrder 
from 
  Workorder 
order by 
  Workorder.CompanyName

just to see if anything looks off
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,325
Members
451,697
Latest member
pedroDH

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