June 7, 2011 at 7:57 am
Can anyone help me as I am getting error on this query.
Msg 156, Level 15, State 1, Line 21
Incorrect syntax near the keyword 'between'.
declare @EoM datetime
declare @BoD datetime
select @EoM = dbo.fn_Get_EOM
select @Bod =GETDATE()
select top 10 empID,FromDate,ToDate
from employees
where status = 'employed'
and CASE WHEN @EoM between FromDate and ToDate THEN @EOM
ELSE @BoD between FromDate and ToDate
Please help me and Thanks in advance
June 7, 2011 at 7:59 am
ELSE @BoD END between
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537June 7, 2011 at 8:00 am
ELSE @BoD END between FromDate and ToDate
June 7, 2011 at 8:05 am
Thank you so much and I really appreciate your reply.It worked perfect.Thanks a lot once again for each one of you.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply