I have not tested this out past leap year. It seems to be working. I did not test it extensively.
DateDiff.zip
This DB has one form with three text boxes and a control button. It analyzes two dates. It uses the first date as the beginning of a period. It determines which period the second date falls into. Each period is equal to seven days.
Here is the code if anyone cares to critique it. It seems access does not offer built in symmetrical rounding so I used a function off of microsoft's KB.
Code:
Function SymUp(ByVal X As Double, _
Optional ByVal Factor As Double = 1) As Double
Dim Temp As Double
Temp = Fix(X * Factor)
SymUp = (Temp + IIf(X = Temp, 0, Sgn(X))) / Factor
End Function
'Evalute two dates and determine the period
'the second date falls within where seven
'days equals one period
Private Sub cmdDateDiff_Click()
Dim dtOne As Date
Dim dtTwo As Date
Dim intAnswer As Integer
Dim sglMath As Single
Dim intRound As Integer
dtOne = Me.txtOne.Value
dtTwo = Me.txtTwo.Value
intAnswer = DateDiff("d", dtOne, dtTwo) 'Count the number of days
intAnswer = intAnswer + 1 'Add the evaluation date back into the equation
sglMath = intAnswer / 7 'Measure days in units of 7
intRound = SymUp(sglMath) 'Round any fraction symmetrically
Me.txtAnswer.Value = intRound
End Sub