[thelist] SQL Assistance

Morgan Kelsey morgan at morgankelsey.com
Tue Apr 1 11:22:26 CST 2003


michelle,

subquery to the rescue...


> I've dummed down this query greatly in order to try to find a solution to
the > problem. The real query is far more complex .. but for simplicity this
shows > the problem we are encountering.  This is from the sql query builder
in
> Access 2K.

ah, well *there's* your problem, heh...query wizard...grumble grumble

SELECT
Contacts.ContactID,
Module.ModuleContactID,
Module.ModuleID,
Module.Module,
Address.AddressType,
AddressContactID AS (SELECT TOP 1 id FROM Address WHERE AddressContactID =
ContactID)
FROM
Contacts
INNER JOIN [Module] ON Contacts.ContactID = Module.ModuleContactID
WHERE (((Module.Module)="CO" Or (Module.Module)="COWEB"));

TOP 1 may not be what you want, but you get the idea...

did i really beat rudy to this one?


nagrom
http://morgankelsey.com



More information about the thelist mailing list