query not working..

keybearer

Registered User.
Local time
Today, 15:40
Joined
Jul 7, 2003
Messages
41
hi.. i want to display the names of all the people except those who are deceased.. below is the sql query that i used but it's not working.. i just get an empty result..

Code:
SELECT IIf([Membership]="LM","LM" & [ID_No],[ID_No]) AS MbrShp, OPA_Contacts.Name, OPA_Contacts.RegtNo, OPA_Contacts.Company, OPA_Contacts.YearIn, OPA_Contacts.YearOut, [FormIn]+" - "+[FormOut] AS Forms
FROM OPA_Contacts
WHERE OPA_Contacts.Remark = NOT "Deceased";

if i do this without the where clause, everyone is displayed including the deceased..
 
WHERE OPA_Contacts.Remark <> "Deceased"
 
If you might have null values in the field and you want them to be included since they are also <> "deceased", you'll need to account for them specifically.

WHERE OPA_Contacts.Remark <> "Deceased" Or OPA_Contacts.Remark Is Null;
 

Users who are viewing this thread

Back
Top Bottom