I need to calculate the number of weeks between 2 dates. This will be used in a billing system.
If something comes in on Thursday, they must get billed for that whole week.
Here is my code that I tried. The code gives me wrong values. Only on the 3rd week, my week count is 1.
vb.net Code:
Private Function DIFF(ByVal THEDATE As Date) Dim i As Integer i = DateDiff("ww", THEDATE, Now.Date, FirstDayOfWeek.Monday) Return i End Function
Honestly I cant see why this isn't working properly. Probably my lack of experience. Can anyone help me here?
The code must be able to calculate the number of weeks between
12/15/2008 - 30/10/2010 for example




Reply With Quote
