using multiple conditions in a where clause

T

talktobatchu

hello

I'm using a query in MS Access 2003 in which I need to find out the sum of
"number of cases" basing upon the WHERE clause. The query looks something as
follows:

SELECT SUM(table1.numberofcases) FROM table1 WHERE (table1.countyname =
"county1", "county2", "county3"...);

whenever I write a SQL query, it shows, invalid expression comma present in
the expression. So how do I write my query in order to find the sum for all
the counties I need.

thanks for any help.
talktobatchu
 
D

Duane Hookom

SELECT SUM(table1.numberofcases) FROM table1 WHERE countyname IN ("county1",
"county2", "county3"...);
 
T

talktobatchu

hello Duane

When I try to execute the same thing in the SQL query, it gives me an error
saying: 'Syntax error in Query Expression' and I wrote the query as:

SELECT SUM(table1.numberofcases) FROM table1 WHERE table1.countyname IN
("county1","county2", "county3"...);

Don't know why it is giving me a problem while executing the query.

anyway thanks for your kind help.

talktobatchu
 
D

Duane Hookom

Did you include the "..." which was only meant as a place holder to
"...continue with more values..."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top