By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,659 Members | 1,678 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,659 IT Pros & Developers. It's quick & easy.

Select Statement Array Trouble

P: 14
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
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,370
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.