0

Problem: Need to account for delays in review process.
The field "EC2WL" is when an employee submitted a case to the Work Leader for review and the field "WL1stReview" is when the Work Leader first reviewed the case. If the difference between those two dates is greater than 7 days, the case is considered delayed. When a case is delayed, the amount of delay is calculated by subtracting 7 from the difference in days between the two fields.
Similarly, a case delay can happen at the section manager level. The fields to consider here are "FODReview" which is the date the case is submitted to the section manager, and "SM1stReview" the date the section manager first reviews the case.
I need these delays to sum in the field "CaseDelay" when I mailout a case.
I currently have a functioning ElseIf code that populates "CaseDelay" with a placeholder of "69" when certain conditions are met that would require a case delay to be calculated. I need to replace the "69" with a functioning piece of code.

Private Sub Mailout_AfterUpdate()
If Me.FODReview > #1/1/1980# Then
    Me.CaseDelay = "69"
Else
    Me.CaseDelay = ""
End If
3
  • Nothing prevents something like SELECT ..., SUM(IIf(SecondDate-FirstDate-7>0),SecondDate-FirstDate-7,0) AS DelaySum ... GROUP BY .... PS. It is (judging by the date literal format) MS Access or something similar? specify, including version... – Akina Jul 17 '19 at 4:42
  • That is some kind of programming language, not SQL. This might be better suited for stackoverflow.com – a_horse_with_no_name Jul 17 '19 at 6:14
  • okay. I can move it over there then. Wasn't aware of the differences. And yes, this was an access vba question. – Jasuan Jul 17 '19 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.