Click here to Skip to main content
15,913,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

I need to Calculate the Startdate(29/07/2011)+2day=Today(1/8/2011)

dateadd(day,2,startdate)=getdate()

Cant get the result properly

Pl help

Praveen
Posted
Comments
walterhevedeich 31-Jul-11 21:47pm    
It doesn't make sense to me. If the start dates are different, adding a constant value will not equal to today's date. What result exactly do you want? Describe more in detail.

Hi,
Use following query:
SQL
SELECT * FROM Employee WHERE  CONVERT(varchar,DATEADD(dd, 2, StartDate),108) = CONVERT(varchar,GETDATE(),108)
 
Share this answer
 
v2
Hi Praveen

The following query which helps you,

SQL
select case when dateadd(day, 2, startdate)=getdate() then '1' else '0' end



Hariharan
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900