[AccessD] query select in column

Gustav Brock Gustav at cactus.dk
Thu Dec 29 09:49:42 CST 2011


Hi Pedro

Perhaps a union query will do:

Select tbl2.pat, tbl2.opendate, tbl2.code from tbldialysis as tbl2
inner join 
(select distinct pat from tbldialysis where code=325) as tbl1 
on tbl1.pat = tbl2.pat 
where tbl2.code in (326,327)
union all
Select tbl2.pat, tbl2.opendate, tbl2.code from tbldialysis as tbl2 
inner join 
(select distinct pat from tbldialysis where code in (326,327) as tbl1 
on tbl1.pat = tbl2.pat 
where tbl2.code=325;

/gustav


>>> pedro at plex.nl 29-12-2011 14:54 >>>
Hello William,

I  made a second table with only the code=325 records in it.
But i get an syntax-error when using the query;

Select tbl2.pat, tbl2.opendate, tbl2.code from tbldialysis as tbl2 inner
join (select distinct pat from tbldialysis where code=325) as tbl1 on
tbl1.pat = tbl2.pat and tbl2.code in (326,327);

i can't figure out why (after correction of misspelled words?

What am i doing wrong?

Pedro




More information about the AccessD mailing list