SQL statement

KenHigg

Registered User
Local time
Today, 00:33
Joined
Jun 9, 2004
Messages
13,327
Can all of this be combined into one sql statement?

Code:
SELECT tblGroups.group_recno, 

tblGroups.group_name, 

selCurrentFormGroupsAvail_01.group_recno

FROM tblGroups 

LEFT JOIN selCurrentFormGroupsAvail_01 

ON tblGroups.group_recno = selCurrentFormGroupsAvail_01.group_recno

WHERE (((selCurrentFormGroupsAvail_01.group_recno) Is Null));


Where selCurrentFormGroupsAvail_01 is this query:


SELECT tblGroups.group_recno, 

tblFormGroups.form

FROM tblGroups 

INNER JOIN tblFormGroups 

ON tblGroups.group_recno = tblFormGroups.group

WHERE (((tblFormGroups.form)=[Forms]![frmFormGroups]![from_recno]));
 
Does this actually give results? If group_recno, on either side of the join, is null, then it is null on the other side of the join.

I guess my stab at it would be:
Select '', tblGroups.group_name, ''
from tblGroups
where tblGroups.group_recno is null;

But I don't think that is what you want.
 
Thanks George, I'm still poking around with it myself :)
 
You might want to fiddle around with where x not in (select blah blah blah).

Not sure what you're trying to do.

But you can definitely make a single query, possibly with sub-queries. But the one you have will always only give you groups with a null recno.
 

Users who are viewing this thread

Back
Top Bottom