Question : How to run a MS Access Query?

I have a database table called Contact People. It has a Query by Last Name however I would like for it to narrow the search, e.g. after obtaining a list of persons with Last Name "Smith" for example then narrow search by "Organization, company, etc..."
Here is the SQL data: SELECT tblContactPeople.*, tblCountry.Country, tblNationality.Nationality, tblStudied.Studied, tblNatureOfContact.NatureOfContact FROM tblStudied INNER JOIN (tblNatureOfContact INNER JOIN (tblNationality INNER JOIN (tblCountry INNER JOIN tblContactPeople ON tblCountry.CountryIDPK = tblContactPeople.Countryidfk) ON tblNationality.NationalityIDPK =
tblContactPeople.Natioanlityidfk) ON tblNatureOfContact.NatureOfContactIDPK =
tblContactPeople.NatureOfContactidfk) ON tblStudied.StudiedIDPK =
tblContactPeople.StudiedInUSAidfk;

Answer : How to run a MS Access Query?

What do you mean by 'GROUPED' ??

SELECT *
FROM yourTable
WHERE lastName = 'Smith'
AND Organization = 'IBM'
AND Language = 'German';

if you have different tables for language, organizations and you have normalized database then something like this should also work,

Table Language
LangId    LangName
-------------------------
1             English
2             German
3             French
...

Table Organizations
OrgId         OrgName
--------------------------
1                IBM
2               Oracle
3               Microsoft

then u may have something like

SELECT *
FROM yourTable
WHERE lastName = 'Smith'
AND OrganizationId = (SELECT OrgId FROM Organization where orgName = 'IBM')
AND LanguageId =  (SELECT LangId FROM Language where LangName = 'German');

To be Generic

SELECT UserName
FROM yourTable,Language,Organization
WHERE lastName = 'Smith'
AND yourTable.OrganizationId = Organization.orgId
AND yourTable.LanguageId = Language.langId;
Random Solutions  
 
programming4us programming4us