A) this is SQL code... you should probably post to a SQL Server users group
B) this is part of the code, but not the offending part. You are creating
the where clause. However, in order to get the error you are getting, you
have to be appending this where clause to a SQL statement like Select or
Insert. That is the location of your error.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:Ol****************@TK2MSFTNGP10.phx.gbl...
SELECT @sql = 'where voucherno =' + quotename(@voucherno,'''') + ' and
recid = ' + str(@recid)
As I print the above statment to check , the syntax is correct
Where voucherno ='GL123' and recid = 123
However, I got this error "Unclosed quotation mark before the character
string 'and recid = 123'
Please help
From AGnes