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
 
Thanks for the video. I created a new query with the Workorder table and the Customer table showing the join between ID from Customer table and CompanyName from the Workorder table. I included all of the same fields and put the same criteria as in the initial query from this post.

Same results I get the error type mismatch.
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Please post the SQL code for your new query, and list out the fields in your Customer Table.
 
Upvote 0
SELECT Workorder.ReceivedDate, Workorder.AFRNumber, Workorder.PartNumber, Workorder.SerialNumber, Workorder.CompanyName
FROM Customer INNER JOIN Workorder ON Customer.ID = Workorder.CompanyName
WHERE (((Workorder.CompanyName)<>"American") AND ((Workorder.CloseWorkOrder)=False));


Customer Table:

ID
CompanyName
FirstName
LastName
Address1
Address2
City
State/Province
Country
Phone1
Phone2
Fax
Email
Website
Notes

***
ID is primary key and autonumber. All else are short text fields
 
Last edited:
Upvote 0
You are still checking the numerical field in the Workorder table for your text string, you should put the criteria against the field in the customer table....

Code:
SELECT Workorder.ReceivedDate, Workorder.AFRNumber, Workorder.PartNumber, Workorder.SerialNumber, Workorder.CompanyName
FROM Customer INNER JOIN Workorder ON Customer.ID = Workorder.CompanyName
WHERE (((customer.CompanyName)<>"American") AND ((Workorder.CloseWorkOrder)=False));
 
Upvote 0
It works great but I have a question. Is the field 'State/Province' okay the way it is with the slash?
 
Upvote 0
No problem :)

Yeah, access will allow the slash and I don't think it causes issues in the application (since 2010 anyway) . I personally don't use any non alphanumeric characters, but this is due to issues I found with other databases years ago now.
 
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