And tips, code, ideas, etc would be most appreciated.
TIA
Roz
Cheers
Ken
"Roz" <ros...@nospam.swbell.net> wrote in message
news:28SCa.1356$9L6...@newssvr32.news.prodigy.com...
: Hello, all. I'm trying to figure out how to calculate the
:
:
<%
datefrom = date
dateto = date - 100
Response.write "Business Days: " & BusinessDateDiff(datefrom,dateto)
Public Function BusinessDateDiff( Date1 , Date2 )
Dim iWeekday1
Dim iWeekday2
Dim lDateDiff
Dim lWeeks
Dim dTemp
If Date1 > Date2 Then
dTemp = Date1
Date1 = Date2
Date2 = dTemp
End If
iWeekday1 = WeekDay(Date1, vbMonday) - 1
iWeekday2 = WeekDay(Date2, vbMonday) - 1
If iWeekday1 > 4 Then iWeekday1 = 4
If iWeekday2 > 4 Then iWeekday2 = 4
lWeeks = DateDiff("w", Date1, Date2)
If iWeekday1 <= iWeekday2 Then
lDateDiff = (lWeeks * 5) + (iWeekday2 - iWeekday1)
Else
lDateDiff = ((lWeeks + 1) * 5) - (iWeekday1 - iWeekday2)
End If
BusinessDateDiff = lDateDiff
End Function
%>
"Roz" <ros...@nospam.swbell.net> wrote in message
news:28SCa.1356$9L6...@newssvr32.news.prodigy.com...
-------------------------------------------------
d l b j r
Unambit from meager knowledge of inane others,
engender uncharted sagacity.
-------------------------------------------------
Roz
>.
>
I see this question (or the like) frequently in here that involve relatively
simple math. Remember that kid in high school Alegbra who said, "When am I
ever going to use this?". Answer: When you become a programmer or scalable
website designer.
:
: Cheers