Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type mismatch in expression error

Status
Not open for further replies.
May 28, 2003
13
US
I am getting a "type mismatch" error when I try to run this query that is pulling info from a lookup table. Access help told me it was a problem, but not how to fix it. It told me I should use them (foreign keys) when you specify criteria for a field. How do I do this?

Do relationships between tables have anything to do with this?


Andy b,

---And Then Nothing Turned Itself Inside Out---
 
Relationships between tables do help join query links, but where's the query?

John
 
What do you mean, where is the query?

Andy b,

---And Then Nothing Turned Itself Inside Out---
 
&quot;I am getting a &quot;type mismatch&quot; error when I try to run this query&quot; <- Which query? What is the SQL?

 
SELECT Employee.E_First, Employee.E_Last, Employee.E_Manager, Hours.Hours_Spent, Hours.Date, Hours.Project, Hours.Type
FROM Employee INNER JOIN Hours ON Employee.E_ID = Hours.FristLast

E_manager is what I want it to be grouped by, and this is a lokoup

Andy b,

---And Then Nothing Turned Itself Inside Out---
 
I am going to take a guess. Your employee ID is probably a soc. or similar. You are trying to link 2 different (data)type fields it sounds like. You need to use, for ex. a name to a name or a soc to a soc., etc. Is there an Hours.E_ID?
What is the primary field in both tables? What is the foreign filed in EMPLOYEES table that creates the relationship to HOURS table?
 
I await the answers to denisedosp's questions before being able to help further. She is asking exactly the correct questions.
It does though seem strange that you are joining an employee ID (which is probably e_id) to FristLast in the Hours table, which sounds like a time rather than an employee number and I wonder if this is a possible cause, so in addition to denisedosp's questions I would ask the data types of the employee.e_id and hours.fristlast fields.

John
 
thanks for the help, I needed to join through a query. For some reason that worked...


And I finally got the reason why, joining number and text.

Andy b,

---And Then Nothing Turned Itself Inside Out---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top