需要获取两个日期之间的差异

需要获取两个日期之间的差异

问题描述:



我需要获取两个日期之间的差异
例如:-开始日期(2012年10月30日)结束日期(2012年11月1日)

输出= 19/09/2012以及结果日期的总天数.

在此先感谢

Sucharitha

Hi,

i need to get the diff between two dates
Ex:- startdate(30/10/2012) enddate(11/01/2012)

Output= 19/09/2012 and also total days of result date.

Thanks in Advance

Sucharitha

尝试 DATEDIFF [ ^ ]:
Try DATEDIFF[^]:
SELECT DATEDIFF(day, '2011-01-01', '2011-02-01')


请参阅:

http://www.shabdar.org/sql-server/104-sql-server-calculate-delay-difference-between-two-dates.html [
Refer this:

http://www.shabdar.org/sql-server/104-sql-server-calculate-delay-difference-between-two-dates.html[^]


尝试此链接
http://msdn.microsoft.com/en-us/library/ms189794.aspx [ ^ ]
try this link
http://msdn.microsoft.com/en-us/library/ms189794.aspx[^]