G Guest Sep 7, 2005 #1 Can someone tell me how to calculate the number of weeks between two dates. Your help is appreciated. Thanks, George
Can someone tell me how to calculate the number of weeks between two dates. Your help is appreciated. Thanks, George
A Atul Sep 7, 2005 #2 Subtract the two dates to get a TimeSpan, use its Days property and divide it by 7. -Atul, Sky Software http://www.ssware.com Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
Subtract the two dates to get a TimeSpan, use its Days property and divide it by 7. -Atul, Sky Software http://www.ssware.com Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
H Hari Sep 7, 2005 #3 You can use DateDiff() function (VB.Net) to for getting number of weeks between two dates Function No_of_Weeks(FromDate as Date) as String No_of_Weeks = "No of weeks from today : " & DateDiff("w", Now, FromDate) End Function Other you can also use DateDiff function of SQL Server for computing no of weeks between dates SELECT DATEDIFF(week, '2005-01-01', getdate()) AS no_of_week Regards Hari Sharma NIIT Technologies
You can use DateDiff() function (VB.Net) to for getting number of weeks between two dates Function No_of_Weeks(FromDate as Date) as String No_of_Weeks = "No of weeks from today : " & DateDiff("w", Now, FromDate) End Function Other you can also use DateDiff function of SQL Server for computing no of weeks between dates SELECT DATEDIFF(week, '2005-01-01', getdate()) AS no_of_week Regards Hari Sharma NIIT Technologies