Chris said:
I have a query that I need to calc the weekdays with and
not the entire calenday week. Age: ([Date_Received]-
[Date]) How can I calc this in the query?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Found this on the web some time ago:
Function Work_Days (BegDate As Variant, EndDate As Variant) As Integer
' Note that this function does not account for holidays.
Dim WholeWeeks As Variant
Dim DateCnt As Variant
Dim EndDays As Integer
BegDate = DateValue(BegDate)
EndDate = DateValue(EndDate)
WholeWeeks = DateDiff("w", BegDate, EndDate)
DateCnt = DateAdd("ww", WholeWeeks, BegDate)
EndDays = 0
Do While DateCnt < EndDate
If Day(DateCnt) Mod 6 <> 1 Then
EndDays = EndDays + 1
End If
DateCnt = DateAdd("d", 1, DateCnt)
Loop
Work_Days = WholeWeeks * 5 + EndDays
End Function
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQeLtCoechKqOuFEgEQK1LwCgvzVik62hrIc4TvhYzyBo0RSM1mwAmgOo
3k1AEDmfEPCQr2HC3WJP7GA2
=WY4j
-----END PGP SIGNATURE-----