Please tell me what is error in my date comparision sql query
- by Rajesh Rolen- DotNet Developer
please help me to find out error in my sql query. i have created this query to compare dates
select * from Joinplans jp
where cast(convert(varchar ,GETDATE(),103) AS datetime) BETWEEN
CASE(convert(varchar,jp.planstartDate,103) AS datetime) AND
CASE(convert(varchar,DATEADD(DAY,jp.planDays,jp.planstartDate),103) AS DATETIME)
It's giving me the error:
incorrect near 'AS'
I am using SQL Server 2005.