I am trying to develop a procedure that will calculate the working days of the month and assign that number to a variable. Currently I am doing it manually I was hoping there is a way to calulate it so I don't have to do it every month. Any help is appreciated.
Tom
My problem is my loop from 9-30 is not calculating the intDay properly.
Tom
Code:
dteDate = Date
If dteDay = #3/29/2013# Then intDay = 1
If dteDay = #4/1/2013# Then intDay = 2
If dteDay = #4/2/2013# Then intDay = 3
If dteDay = #4/3/2013# Then intDay = 4
If dteDay = #4/4/2013# Then intDay = 5
If dteDay = #4/5/2013# Then intDay = 6
If dteDay = #4/8/2013# Then intDay = 7
If dteDay = #4/9/2013# Then intDay = 8
If dteDay > #4/9/2013# Then
For intI = 9 To 30
intDay = intDay = Weekday(Date, vbMonday)
Next intI
dtetime = #2:00:00 AM#
'dtetime = #12:15:00 PM#
'dtetime = #6:00:00 PM#
'if
If dtetime > #12:00:00 AM# Or dtetime <= #8:00:00 AM# Then intTime = 0.1
If dtetime > #8:00:01 AM# Or dtetime <= #11:00:00 AM# Then intTime = 0.2
If dtetime > #11:00:01 AM# Or dtetime <= #1:00:00 PM# Then intTime = 0.3
If dtetime > #1:00:01 PM# Or dtetime <= #3:00:00 PM# Then intTime = 0.4
If dtetime > #3:00:01 PM# Or dtetime <= #5:00:00 PM# Then intTime = 0.5
If dtetime > #5:00:01 PM# Or dtetime <= #11:59:59 PM# Then intTime = 0.6
intDayTotal = intDay + intTime
strSQL = "INSERT INTO tblTime (ClientID,ClientName,Day,RptProcStart)" _
& " VALUES (" & liClntID & ",'" & strUCI & "'," & intDayTotal & ",Now())"
CurrentDb.Execute strSQL
My problem is my loop from 9-30 is not calculating the intDay properly.