Help comparing dates VB.NET
Posted on 2012-08-14
Given variables ReceivedDate and ProcessDate
I want to run this date through a function and return the result of "ON TIME" or "LATE" and the number of days it is late.
If ReceivedDate is after 12noon on a Friday, then ProcessDate must be by 5pm on Monday, else it is late.
If ReceivedDate is after 12noon on Monday-Thursday then ProcessDate must be by 5pm the next day or else it is late
If ReceivedDate is before 12noon on any weekday, then ProcessDate must be by 5pm that day or it is late.
The function should return "ON TIME" or "Late by X Days" where X = the count of days after required time has past.
ReceivedDate was Tuesday at 9:00am
ProcessDate was Wednesday at 6:00pm
This is 1 day late
ReceivedDate was Tuesday at 7:00PM
ProcessDate was Wednesday at 3:00pm
This is on time
ReceivedDate was Friday at 7:00am
ProcessDate was Tuesday at 3:00pm
This is 4 days late or 2 days late, im fine either way if weekends are counted or not for computing days late- (It was due Friday by 5pm)
Please help me with VB code, I can't read C