Hi
I am wrking on a application where i need to calculate the difference between two dates ..
here is the formula i am using
........
Public Function GetNumberOfWork Days(sStartDate , sEndDate)
Dim iWorkDays
iWorkDays = (sEndDate - sStartDate) / 365.25
GetNumberOfWork Days = iWorkDays
End Function
...............
this gives me the difference in years i.e in integer format for example if the difference b/w two date is 2.5 years then i get it as 3 years i.e the duration is rounded off to 3years in place of 2.5 years ...now i need to display this time duration in float format ..where the exact duration is displayed as 2.5 years .....
so pls...could anyone gimme a solution for this ..
Thanks
infobescom
I am wrking on a application where i need to calculate the difference between two dates ..
here is the formula i am using
........
Public Function GetNumberOfWork Days(sStartDate , sEndDate)
Dim iWorkDays
iWorkDays = (sEndDate - sStartDate) / 365.25
GetNumberOfWork Days = iWorkDays
End Function
...............
this gives me the difference in years i.e in integer format for example if the difference b/w two date is 2.5 years then i get it as 3 years i.e the duration is rounded off to 3years in place of 2.5 years ...now i need to display this time duration in float format ..where the exact duration is displayed as 2.5 years .....
so pls...could anyone gimme a solution for this ..
Thanks
infobescom
Comment