Prev: Tables in Access Queries overwritten??? :(
Next: I need to add the letter "Z" to the end of every contract ID
From: CRBI on 14 Jan 2010 09:42 I have a query based on a membership table in which I need to pull out all the people who do not have an email address. When I design the query and put "is null" in the criteria field for email address, it still returns names with email addresses. How can I get this query to pull out only the members who do not have an email address?
From: Dorian on 14 Jan 2010 09:52 Well what do you have in the columns with no email address? You should have a null but its possible your code puts either an empty string or a space in there. Since an email address should contain an '@' character you could try WHERE NOT LIKE "*@*" you may have to use % instead of *, can't remember which is correct. -- Dorian "Give someone a fish and they eat for a day; teach someone to fish and they eat for a lifetime". "CRBI" wrote: > I have a query based on a membership table in which I need to pull out all > the people who do not have an email address. When I design the query and put > "is null" in the criteria field for email address, it still returns names > with email addresses. How can I get this query to pull out only the members > who do not have an email address?
From: Pendragon on 15 Jan 2010 10:45
You also have to be sure to repeat any other criteria which may appear on a different criteria line. For example, if in Membership ID you had <>99 on one line and <>100 on the second line, having Is Not Null in the email address criteria on only one line means that is being applied only with the <>99 criteria. You would need to have Is Not Null also on the same line as <>100. "Dorian" wrote: > Well what do you have in the columns with no email address? > You should have a null but its possible your code puts either an empty > string or a space in there. > Since an email address should contain an '@' character you could try > WHERE NOT LIKE "*@*" > you may have to use % instead of *, can't remember which is correct. > -- Dorian > "Give someone a fish and they eat for a day; teach someone to fish and they > eat for a lifetime". > > > "CRBI" wrote: > > > I have a query based on a membership table in which I need to pull out all > > the people who do not have an email address. When I design the query and put > > "is null" in the criteria field for email address, it still returns names > > with email addresses. How can I get this query to pull out only the members > > who do not have an email address? |