S
Saabster
I've got the following code in a report:
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As
Integer)
dteStart = Forms!frmUtilizationRpt!txtStartDate
dteEnd = Forms!frmUtilizationRpt!txtEndDate
varDays = DateDiff("d", dteStart, dteEnd)
varDays = (varDays / 7) * 5
intNumHours = varDays * 8
lngUtil = Me.SumOfHours / intNumHours
Me.txtHrsInPeriod = intNumHours
Me.txtUtilPercent = lngUtil
End Sub
I'm wondering if the DateDiff() function will take into account the
starting and ending dates, or just the days between the 2 dates. For
example if I have dteStart as 01/01/2006 and dteEnd as 01/15/2006 I
would expect it to count either 15 days if it is inclusive or 13 days
if it is exclusive.
When I tested it, it counted 14 days, so which day is it loosing or
adding?
Thanks in advance
Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As
Integer)
dteStart = Forms!frmUtilizationRpt!txtStartDate
dteEnd = Forms!frmUtilizationRpt!txtEndDate
varDays = DateDiff("d", dteStart, dteEnd)
varDays = (varDays / 7) * 5
intNumHours = varDays * 8
lngUtil = Me.SumOfHours / intNumHours
Me.txtHrsInPeriod = intNumHours
Me.txtUtilPercent = lngUtil
End Sub
I'm wondering if the DateDiff() function will take into account the
starting and ending dates, or just the days between the 2 dates. For
example if I have dteStart as 01/01/2006 and dteEnd as 01/15/2006 I
would expect it to count either 15 days if it is inclusive or 13 days
if it is exclusive.
When I tested it, it counted 14 days, so which day is it loosing or
adding?
Thanks in advance