TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Janine
NA
8
41.8k
Syntax error
Dec 17 2010 9:21 AM
Hi, I am new to sql statements, just wondering if anyone can help me sort out the syntax error I am getting. I am not sure what's wrong...
SET
@SQL
=
@SQL
+
' WHEN OEMP.eMPLOYEEACTIVE = ''INACTIVE'' AND payYTDDeductions.pCheckDate BETWEEN '''
+
convert
(
varchar
,
@StartDate
,
101
)
+
''' AND '''
convert
(
varchar
,
@EndDate
,
101
)
+
''' '
+
CHAR
(
13
)
SET
@SQL
=
@SQL
+
' AND DATEDIFF(YY,'''
+
convert
(
varchar
,
@StartDate
,
101
)
+
''' , OEMP.INACTIVEDATE)<=1 '
+
CHAR
(
13
)
The syntax error has to to with, or is near the convert, but not sure how to change it
Reply
Answers (
1
)
"Sorting using the relavance"
how to add column data in MSSQL