FN-FORUM: One for the SQL Experts
date posted 10th September 2007 22:03
Hi,
I'm trying to build a query in classic ASP to fire against a MySQL 5.0
server that can look inside a field value.
So far I have:-
strSQL = "SELECT COUNT(mailingListID) AS recount FROM tblMailingList WHERE
IsNull(unsubscribe) AND domainReg = '" & strDomain & "'"
There is a tblMailingList.mailingGroupID field that has recently been
converted to hold a comma delimited list of mailingGroupID's. I need to add
something to this query to say "AND the supplied number exists in
mailingGroupID" but in SQL of course. In other words, if the mailingGroupID
field holds: 5,2,6,8,2 and the supplied number is 2 then I want it included
in the count.
Would this be a sub-query, can it be done, am I going about it all the wrong
way?
Any advice gratefully received.
Craig