I want to calculate the total number of days using sql My requirement is I have posted date and a current date using these two dates i want to calculate the total number of days
Hi Frndz,
Functionality: Get two date difference in Day in Sql server
Use DateDiff Function
Logic :
Declare @PassDate as Varchar(10) = '06/14/2012' -- MM/dd/yyyy
Select DATEDIFF(DAY,CAST('06/14/2012' as DateTime), GETDATE()) as DifferDay
Hope this helpful!
Thanks