468,103 Members | 1,328 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

Syntax error converting datetime fom character string

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
1 4449
code green
1,726 Expert 1GB
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.

Similar topics

11 posts views Thread by jguilford | last post: by
4 posts views Thread by Carl | last post: by
1 post views Thread by amitbadgi | last post: by
14 posts views Thread by eric.goforth | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.