Union Query Type Mismatch

wizcow

Registered User.
Local time
Today, 01:55
Joined
Sep 22, 2001
Messages
236
Hi

I have a Union query that is giving me results from two tables.
One table has the field 'PractitionerID'
The other table does not.

I am using this SQL statement to get the 'PractitionerID' into the recordset.

SELECT[InvoiceDate],"1" AS [PractitionerID]
FROM table1

UNION SELECT[InvoiceDate], [PractitionerID]
FROM table2

The next step is to get the Practioner's name into the data.
I use another query based on the Union query. I added the 'Employees' table to the query.

The problem is when I join the 'PractitionerID' to the 'EmployeeID' I get the type mismatch error.
Even though they both are displaying a number value.

Does anyone have any ideas to get around this so I can get the Practitoners name into the second query?

Thanks
Tom
 
Tom,

Welcome back!

The union query wants each result field to be of the same type.

"1" and 1 are string and numeric respectively.

Even if you forced a numeric 1 into every column from table1
I don't know what that buys you.

Wayne
 
Thanks for the help Wayne!

Ah, yes the quotes signify a string. I missed that.
As it turns out, the numeric 1 buys me exactly what I needed.

Tom
 

Users who are viewing this thread

Back
Top Bottom