how to check date difference in sqlserver [Resolved]

Posted by Naseer under Sql Server on 3/3/2014 | Points: 10 | Views : 1481 | Status : [Member] | Replies : 2
Hi,


In my database i am saving date in the format "31-03-2014" ,i need to check date after 14days from the date of entry,i need to find datediffernce

i am trying below query but its not working for me

ex:
SELECT DATEDIFF(DD,'28-02-2014',GETDATE())

expected op:3




Responses

Posted by: Bandiranjithreddy on: 3/4/2014 [Member] Starter | Points: 50

Up
0
Down

Resolved
Try the below, it will work.
select DATEDIFF(DD,convert(datetime,'21-02-2014 00:00:00',105),GETDATE()) AS DiffDate

If it work kindly update the status as resolved or Complete

Naseer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naseer on: 3/4/2014 [Member] Starter | Points: 25

Up
0
Down
I used 105 ,its worked for me thanq for your help

Naseer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response