I'm running a report at X time every Y hours. Each time the report runs my vb.net windows form application calculates the next run time and stores that datetime. I anticipated some drift of time where the report will get progressively later in the day so I kept the original "base time" as a field in the database for this record. I'm trying to figure out a way to measure if the next run time is more than a minute past the "base time" and if so force the next run time back to the base time. Aircode:
If nextRunTIme(hh:mm) - BaseTime(hh:mm) > 1 then
NetRunTime = correct NextRunTime Date but BaseTime Hours:Minutes
End If
In other words:
If NextRunTime (12/24/2012 9:05 PM) - BaseTIme(9/12/2012 9:00 PM) > 1 Then
NextRunTime = 12/24/2012 9:00 PM
End If
Take the date from NextRunTime but the TIME from BaseTime?
Thank You