Date Difference

  • Thread starter Thread starter Sonu
  • Start date Start date
S

Sonu

Hi

I want to calculate the no of days between 2 given days.
Using c#.But the start date and the end date should not be
counted.Eg., Diff between 01/01/2003 and 01/10/2003
(mm/dd/yyyy format)should be 8 days.

Thanks
Sonu
 
Hello,

Sonu said:
I want to calculate the no of days between 2 given days.
Using c#.But the start date and the end date should not be
counted.Eg., Diff between 01/01/2003 and 01/10/2003
(mm/dd/yyyy format)should be 8 days.

Untested:

\\\
Dim d1 As Date = #1/1/2003#
Dim d2 As Date = #1/10/2003#
MsgBox(d2.Subtract(d1).Days - 1)
///

HTH,
Herfried K. Wagner
 
Back
Top