LeighWardle
asked on
Query to filter out "free" email addresses
Hi Experts,
I want to create a query that will filter out "free" email addresses using domains such as hotmail.com.
Assume I have a Table called "Free Email Domain Names", with sample records like this:
strFreeDomainName
hotmail.com
yahoo.com
mail.com
Also assume I have a Table of email addresses, "Emails", with sample records
strEmail
bob@hotmail.com
jack@yahoo.com
real.person@somecompany.co m
The query should return:
real.person@somecompany.co m
Regards,
Leigh
I want to create a query that will filter out "free" email addresses using domains such as hotmail.com.
Assume I have a Table called "Free Email Domain Names", with sample records like this:
strFreeDomainName
hotmail.com
yahoo.com
mail.com
Also assume I have a Table of email addresses, "Emails", with sample records
strEmail
bob@hotmail.com
jack@yahoo.com
real.person@somecompany.co
The query should return:
real.person@somecompany.co
Regards,
Leigh
ASKER
Thanks pratima_mcs,
I am getting a syntax error:
Missing ), ], or Item in query expression 'Substring(strEmail,CharIn dex('@',st rEmail)+1, Len(strEma il) not in (Select
strFreeDomainName from Free_Email_Domain_Names)'.
Regards,
Leigh
I am getting a syntax error:
Missing ), ], or Item in query expression 'Substring(strEmail,CharIn
strFreeDomainName from Free_Email_Domain_Names)'.
Regards,
Leigh
select strEmail from Email_address
where Substring(strEmail,CharInd ex('@',str Email)+1,L en(strEmai l)) not in (Select strFreeDomainName from Free_Email_Domain_Names)
where Substring(strEmail,CharInd
ASKER
Thanks pratima_mcs,
Now I am getting this error:
Undefined function 'Substring' in expression.
I am running MS Access 2003.
Regards,
Leigh
Now I am getting this error:
Undefined function 'Substring' in expression.
I am running MS Access 2003.
Regards,
Leigh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks pratima_mcs,
Regards,
Leigh
Regards,
Leigh
where Substring(strEmail,CharInd