By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,766 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,766 IT Pros & Developers. It's quick & easy.

Syntax error converting datetime fom character string

P: 31
Hi I get the error "Syntax error converting datetime from character string "for
the following sql statement in Stored proc.

SET @dynamicSQL =N'SELECT CUSTID,SHCodeLink FROM AccountMaster where CONVERT(DATETIME,OPDATE,105) < = '''+CONVERT(DATETIME,@ACCYEAR,105) +''' And GLCode = '+@DIVGLCODE

EXEC(@dynamicsql)
May 26 '09 #1
Share this Question
Share on Google+
1 Reply


code green
Expert 100+
P: 1,726
It is usually a stray quotation -
that is quotes where they shouldn't be or vice-versa.
Can't tell from your post because you haven't wrapped in CODE.
May 26 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.