Please program in more days, read the subject of one of Peter's unread e-mails. As the replacement for Noah, the company's veteran programmer, Peter was starting to get used to strange-sounding emails requesting simple hacks and tweaks to applications used by their clients. He opened up the message ...

Hey Peter -- Could you add more days into our transaction age report? Not sure if that makes any sense, but Noah had to do this whenever we wanted to run against longer periods.

After a little bit of investigating, Peter found out why they were running out of days ...

'Calculate days/hours based on total
'  Hopefully, we wont need to go
'  more granular than 12h
If totalHours <= 12 Then
  dayCount = 0
  hourCount = 12
ElseIf totalHours <= 24 Then
  dayCount = 1
  hourCount = 0
ElseIf totalHours <= 36 Then
  dayCount = 1
  hourCount = 12
ElseIf totalHours <= 48 Then
  dayCount = 2
  hourCount = 0

... and so on ...

ElseIf totalHours <= 744 Then
  dayCount = 31
  hourCount = 0
ElseIf totalHours <= 756 Then
  dayCount = 31
  hourCount = 12
Else
  dayCount = 99999
  hourCount = 99999
End If

Peter told them that he'd fix it so they would never "run out of days" and asked if they'd like to see more accuracy than 0 or 12 hours. Their response was priceless: Really??? You can do that under a support call?!?! We'd love that; Noah said it would take thousands of codes to do that.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!