N
NadSadBad
Hi,
I recently asked how you can calculate the number of days between 2 dates
without including weekends (Sat and Sun) in a query.
Someone came back and offered the following code and said i should call this
function:
Function DateDiffXWE(stDate As Date, fiDate As Date) As Integer
Dim nDays As Integer
nDays = 0
While stDate < fiDate
stDate = DateAdd("d", 1, stDate)
If Weekday(stDate) > 1 And Weekday(stDate) < 7 Then
nDays = nDays + 1
End If
Wend
DateDiffXWE = nDays
End Function
I am new to queries but wanted to know how you call this function in a query
and where exactly do i place the code..if u cant call it in a query, where
then do i call it from.
Any help would be greatly appreciated.
Thanks in advance
I recently asked how you can calculate the number of days between 2 dates
without including weekends (Sat and Sun) in a query.
Someone came back and offered the following code and said i should call this
function:
Function DateDiffXWE(stDate As Date, fiDate As Date) As Integer
Dim nDays As Integer
nDays = 0
While stDate < fiDate
stDate = DateAdd("d", 1, stDate)
If Weekday(stDate) > 1 And Weekday(stDate) < 7 Then
nDays = nDays + 1
End If
Wend
DateDiffXWE = nDays
End Function
I am new to queries but wanted to know how you call this function in a query
and where exactly do i place the code..if u cant call it in a query, where
then do i call it from.
Any help would be greatly appreciated.
Thanks in advance