using multiple conditions in a where clause

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
SELECT SUM(table1.numberofcases) FROM table1 WHERE countyname IN ("county1",
"county2", "county3"...);
 
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
 
Did you include the "..." which was only meant as a place holder to
"...continue with more values..."
 
Back
Top