468,483 Members | 2,598 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,483 developers. It's quick & easy.

Select Statement Array Trouble

I have a newsletter program I'm trying to use a group list like 1,2,3,4 in my database to send email to one or more groups. So I get the groups say 1,2 but when I try to get the email address from a user say in group 1 I get nothing. I believe it not finding the 1 in the list of 1,2,3 if the user is in those groups. Here's what I have:

Expand|Select|Wrap|Line Numbers
  1. NMGroups = Replace(UploadFormRequest("txtGroup"), " ", "") 'remove white space
  2.  
  3.  
  4. strSQL = "SELECT * FROM NewsletterMembers WHERE NMActive = 'True' AND NMGroups IN ('" & NMGroups & "')"
  5. Set sendemails = database.Execute(strSQL)
  6.  
Thanks for your help in advance!!!!
Oct 20 '12 #1
1 1419
Rabbit
12,513 Expert Mod 8TB
If it's numbers, you don't need quotes. If they're strings, you need to demarcate each distinct value with single quotes.
Oct 21 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Karzy | last post: by
1 post views Thread by brett | last post: by
6 posts views Thread by Eric Robinson | last post: by
reply views Thread by Michael Seele | last post: by
reply views Thread by James | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.