I have a table Pax (PaxId, PaxName) and a query qryPaxRooms (RoomPaxId, PaxName). RoomPaxId in the query is an expression with Nz(ResRooms.PaxId,ResPaxid
) AS RoomPaxId. So if a reservation has no rooms yet assigned RoomPaxId will have the PaxId of the reservation otherwise the PaxId of the Room Owner (might be different). Now if I try to join table qryPaxRooms with a different table Invoices (InvID, InvDate, PaxId) on qryPaxRooms.RoomPaxId with Invoices.PaxId I get a type mismatch error. Is it not possible to do a join on expressions? Is there a different solution? Thank you so much for any help! Regards Michael
ASKER CERTIFIED SOLUTION
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As your IDs probably are numeric, try to force a Long for the ID:
Or you could attach a database with sample values.
CLng(Nz(ResRooms.PaxId,ResPaxid)) AS RoomPaxId
Thank you to both of you for your help. Best regards Michael