PC Review


Reply
Thread Tools Rate Thread

counting only weekdays not weekends

 
 
Joyce
Guest
Posts: n/a
 
      29th Jan 2004
I have a report that shows the percent that an established
goal was reached concerning turnaround time on various
file types. The turn around time is 2, 5 or 10 days. I
was given this code to count business days and omit
weekends.

I don't know what the "w" is in the code, can someone
explain that and also this code assumes all turnaround
days are 2, but it can be 2, 5 or 10. How would I list
the turnaround days for each case type. My field name is
CaseTypeID = 1 with a turnaround assigned as 2
CastTypeID = 2 with a turnaround assigned as 5
CaseTypeID = 3 with a turnaround assigned as 10

I appricitae your help, thanks

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)

Dim intAddedDays As Integer
Select Case DatePart("w", DateReceived)
Case vbMonday to vbWednesday
intAddedDays = 0
Case Else
intAddedDays = 2
End Select
DaysForCase = 2 + intAddedDays

End Sub
 
Reply With Quote
 
 
 
 
John Spencer (MVP)
Guest
Posts: n/a
 
      29th Jan 2004
The "w" means the datepart to be returned is the Day of the Week (1-7).

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)

Dim intAddedDays As Integer
Select Case Me.CaseTypeID
Case 1
Select Case DatePart("w", DateReceived)
Case vbMonday to vbWednesday
intAddedDays = 0
Case Else
intAddedDays = 2
End Select
Case 2
IntAddedDays = 5
Case 3
IntAddedDays = 12
End Select

DaysForCase = 2 + intAddedDays

End Sub

Joyce wrote:
>
> I have a report that shows the percent that an established
> goal was reached concerning turnaround time on various
> file types. The turn around time is 2, 5 or 10 days. I
> was given this code to count business days and omit
> weekends.
>
> I don't know what the "w" is in the code, can someone
> explain that and also this code assumes all turnaround
> days are 2, but it can be 2, 5 or 10. How would I list
> the turnaround days for each case type. My field name is
> CaseTypeID = 1 with a turnaround assigned as 2
> CastTypeID = 2 with a turnaround assigned as 5
> CaseTypeID = 3 with a turnaround assigned as 10
>
> I appricitae your help, thanks
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount
> As Integer)
>
> Dim intAddedDays As Integer
> Select Case DatePart("w", DateReceived)
> Case vbMonday to vbWednesday
> intAddedDays = 0
> Case Else
> intAddedDays = 2
> End Select
> DaysForCase = 2 + intAddedDays
>
> End Sub

 
Reply With Quote
 
LisaB
Guest
Posts: n/a
 
      29th Jan 2004
Look up the DatePart Function in the Help menu


"Joyce" <(E-Mail Removed)> wrote in message
news:6d3c01c3e6a2$08bf6fc0$(E-Mail Removed)...
> I have a report that shows the percent that an established
> goal was reached concerning turnaround time on various
> file types. The turn around time is 2, 5 or 10 days. I
> was given this code to count business days and omit
> weekends.
>
> I don't know what the "w" is in the code, can someone
> explain that and also this code assumes all turnaround
> days are 2, but it can be 2, 5 or 10. How would I list
> the turnaround days for each case type. My field name is
> CaseTypeID = 1 with a turnaround assigned as 2
> CastTypeID = 2 with a turnaround assigned as 5
> CaseTypeID = 3 with a turnaround assigned as 10
>
> I appricitae your help, thanks
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount
> As Integer)
>
> Dim intAddedDays As Integer
> Select Case DatePart("w", DateReceived)
> Case vbMonday to vbWednesday
> intAddedDays = 0
> Case Else
> intAddedDays = 2
> End Select
> DaysForCase = 2 + intAddedDays
>
> End Sub



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WEEKENDS VS. WEEKDAYS =?Utf-8?B?VExBbmdlbG8=?= Microsoft Excel Misc 0 10th Jul 2006 06:49 PM
WEEKENDS VS. WEEKDAYS =?Utf-8?B?VExBbmdlbG8=?= Microsoft Excel Misc 7 12th May 2006 05:31 PM
IF statement with Weekends vs. weekdays edwardpestian Microsoft Excel Worksheet Functions 4 7th May 2006 09:13 PM
How do I print weekends the same size as weekdays? =?Utf-8?B?TW8=?= Microsoft Outlook Calendar 1 25th Oct 2005 05:08 AM
Print with same size weekends as weekdays? =?Utf-8?B?RHIuIFRvZGQ=?= Microsoft Outlook Calendar 0 23rd Oct 2005 05:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:14 PM.