if then statement

J

Joyce

I have a month end report that I need that reflects if
research cases are resolved within an established
turnaround time. All but two of my research case types
have a turn around time of 5 days so I actually calculate
using 7 to account for the 2 day weekend. I have two case
types that have a turnaround time of 2 days. I can use
the factor of 2 for cases received on Monday-Wed, however
I need to calculate using 4 for these case types received
on Thursday and Friday. Is there an "if/then" expression
or VBA code I could use to calcuate using 4 for dates that
fall on the specific Thursday and Friday dates. I've
never done an if,then expression or VB code for this. I
need something that will calculate this

If CaseType1 and CaseType4 received on 01/08/2004,
01/09/2004, 01/15/15, 01/16/2004, 01/22/04, 01/23/2004,
01/29/2003 01/30/04 Then TurnAround=4

Currently my report has 4 fields, they are:

Date Received: =Count([DateReceived])

Date Resolved: =Count([DateResolved])

Resolved within TurnAround time: =Count(IIf(DateDiff("d",
[DateReceived],[DateResolved])<=[TurnaroundDays],"Q"))

Percent Resolved within Turnaround Goal:=[txtQuick]/
[txtAccountsResolved]

Thank you for your help.
 
K

Ken Snell

I'm not sure I understand what you're doing here, but let's see if this gets
you started in the right direction. There is a function in VBA called
DatePart, which allows you to identify the actual day of the week for a date
(Monday, Tuesday, etc.). Thus, I would envision that you could use something
like this setup:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top