>  SELECT SUM(quantity) INTO vtotal FROM table WHERE year IN ( &vyears )
> 
> I prefer that for readability, to having the parens embedded within the
> variable.

Bill, I didn't believe this ('cause I was sure I've tried it in the past) but I
did a quick test and of course, you're right.

However, I then repeated the test without the spaces between the paren and the
ampersand, and it STILL worked.  My test used a text column.

When I tried with an integer column, it didn't work either with or without the
spaces.

My results:

SELECT * FROM Table WHERE TextCol IN (&vList)
SELECT * FROM Table WHERE TextCol IN ( &vList )

both work correctly

SELECT * FROM Table WHERE IntCol IN (&vList)
SELECT * FROM Table WHERE IntCol IN ( &vList )

both FAIL with the error "extra comma in expression".

--
Larry

Reply via email to