Can anybody tell me how I would get the records in the first statement that are not in the second statement (see below)?
from or in TblOrganisations
where or.OrgType == 2
select or.PkOrgID
Second query:
from o in TblOrganisations
join m in LuMetricSites
on o.PkOrgID equals m.FkSiteID
orderby m.SiteOrder
select o.PkOrgID
Do you need the whole records, or just the IDs? The IDs are easy…
EDIT: Okay, if you can’t do that, you’ll need something like:
Check the SQL it produces, but I think it should do the right thing. Note that there’s no point in performing any ordering in the second query – or even the join against TblOrganisations. In other words, you could use: