473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1534
Rabbit
12,516 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

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

Similar topics

2
by: Karzy | last post by:
I would like to have a form that gives the user choices for selection parameters for email, printing etc. A real simple example: Give me all ______ who ______ when _______ where _______ I...
1
by: brett | last post by:
Here is my SQL string: "SELECT to_ordnum, to_orddate," _ & "(SELECT SUM((DDPROD.pr_stanmat * DDPROD.pr_prfact) * (DOBOM2.b2_quant * DDORD.or_quant)) FROM DDPROD INNER JOIN DOBOM2 ON...
1
by: John Hall | last post by:
We need to read a SQL database containing a mix of English words and Chinese Characters. We think we need to use the N'xxxx' to read the Unicode. We have one place where the SELECT statement...
6
by: Eric Robinson | last post by:
Hi all, I'm having real trouble wrapping my newbie brain around this problem. Can someone please tell me the most efficient (or any!) way to write a SELECT statement to return a set of rows from...
0
by: Michael Seele | last post by:
hi! i need a list of all primary keys in my database! for this reson i build these sql-statement: /SELECT pg_class.relname AS tableName, pg_constraint.conname AS pkName, pg_constraint.conkey AS...
0
by: James | last post by:
I have put a select statement in the 'select query' proprty of the sql data source, and I am having trouble retrieving it and displaying it to a textbox. This is the error message I am getting:...
2
by: Staj4 | last post by:
Hey, In our application, we need to build an array by selecting from a MS-SQL table. We want to process as follows: 1) Load the array with the SQL select statement 2) Process the array...
2
by: fran7 | last post by:
Hi, I am having trouble with a select statement and not sure how to phrase it. I have many links on one page like this. I need that when you click on one postcardid link all the other...
5
by: chazzy69 | last post by:
Ok here is what im trying to achieve, i first retrieve from one part of my database names and email address, etc which i store in an array i.e. while($row= mysql_fetch_array($result)){ $name =...
2
by: ankitmathur | last post by:
Hi All, I'm facing a problem I'm unable to find a solution for. I hope fellow members would be able to help me out. System Info: PHP v5 MSSQL 2008 Linux box
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.