Wow, I did not know that. I've been doing it the same as Larry but I like your way better! As they say...you learn something new every day.
Thanks for the tip. Dawn -----Original Message----- From: Bill Downall [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 07, 2005 10:05 AM To: RBG7-L Mailing List Subject: [RBG7-L] - Re: In clause of where statement Actually, R:Base only gets confused when the left-parenthesis is adjacent to the ampersand. R:Base does not get confused this way: 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 Lawrence Lustig wrote: > > SELECT SUM(quantity) INTO vtotal FROM table WHERE year IN (&vyears) > > which would substitute the string directly into the SQL statement. > Unfortunately, this syntax has always confused the R:Base expression > parser and will generate an error. The following, however, should work: > > SET VAR vYears = '(' + .vYears + ')' > SELECT SUM(quantity) INTO vtotal FROM table WHERE year IN &vYears >
