D
dcipollone
I have searched this news group but I have not found an answer to my
issue so I'm hoping some can provide a solution for me.
I have 3 tables that I need to query against. I have created 2 union
queries then created another query to query against the 2 union
queries match one of the fields but not the other field and also if one
entry exists in one table but not the other.
The explanation is a bit confusing so here is the query:
SELECT [union].[ptNo], [union].[nurseStat], [union].[Bed],
[union].[AdmtDate], [union].[PtSts], [union].[Div]
FROM [union] LEFT JOIN union2 ON [union].[ptNo]=[union2].[Field1]
WHERE ([union2].[Field1]=[union].[ptNo] And
[union].[Bed]<>[union2].[Field4]) or
([union2].[Field1]<>[union].[ptNo]);
The first part of the query works fine but I cannot get the OR part of
it to work. ANy suggestions welcomed.
issue so I'm hoping some can provide a solution for me.
I have 3 tables that I need to query against. I have created 2 union
queries then created another query to query against the 2 union
queries match one of the fields but not the other field and also if one
entry exists in one table but not the other.
The explanation is a bit confusing so here is the query:
SELECT [union].[ptNo], [union].[nurseStat], [union].[Bed],
[union].[AdmtDate], [union].[PtSts], [union].[Div]
FROM [union] LEFT JOIN union2 ON [union].[ptNo]=[union2].[Field1]
WHERE ([union2].[Field1]=[union].[ptNo] And
[union].[Bed]<>[union2].[Field4]) or
([union2].[Field1]<>[union].[ptNo]);
The first part of the query works fine but I cannot get the OR part of
it to work. ANy suggestions welcomed.