Based on what the error message is complaining about, I'd recommend that you try to remove the semi-colon at the end of the SQL statement.
Also, I don't know where your variable will be getting it's values from, but you might want to check out Little Bobby Tables for info about preventing SQL injection issues.
In reply to Re^3: Passing a perl variable in SQL AND statement
by dasgar
in thread Passing a perl variable in SQL AND statement
by vihar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |