Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

RE: FN-FORUM: One for the SQL Experts

date posted 10th September 2007 22:58

Thanks Paul,

But I think that would fail if the numbers were 2,5,22,222,234 and were
looking for LIKE 2.

Craig

-----Original Message-----

As you might know from my posts I'm no SQL expert, but try:

strSQL = "SELECT COUNT(mailingListID) AS recount FROM tblMailingList
WHERE IsNull(unsubscribe) AND domainReg = '" & strDomain & "' AND
mailingGroupID LIKE '" & myVar & "';"

hth
Paul

On 10 Sep 2007 21:38:48 -0000, Craig [EMAIL REMOVED] wrote:
>
> 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
>
>
>
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>
--
Freelancers, contractors earn more with Prosperity4
Call 0870 870 4414 or visit www.prosperity4.com
and benefit from Inland Revenue approved expenses today.

To advertise here: http://www.freelancers.net/advertising.html



Messages by Day
September 30th 2007
September 29th 2007
September 28th 2007
September 27th 2007
September 26th 2007
September 25th 2007
September 24th 2007
September 23rd 2007
September 22nd 2007
September 21st 2007
September 20th 2007
September 19th 2007
September 18th 2007
September 17th 2007
September 16th 2007
September 15th 2007
September 14th 2007
September 13th 2007
September 12th 2007
September 11th 2007
September 10th 2007
September 9th 2007
September 8th 2007
September 7th 2007
September 6th 2007
September 5th 2007
September 4th 2007
September 3rd 2007
September 2nd 2007
September 1st 2007


Messages by Month
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000