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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top