Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to Detect 3rd Shift Change

Status
Not open for further replies.

jsaliers

Programmer
Jan 23, 2003
129
0
0
US
I am writing a datalog program that tracks counts on a test stand. At each shift or model change, the program should append the counts file to a historical file, then zero the counts and overwrite the existing current file. I can detect when the model changes, or when the shift number changes, but there are days where the stand only runs on 1st shift, and not 2nd or 3rd, then again on 1st the next day. If they run the same model, then the model and shift are the same, and it won't write to the historical count file. The easy way is to check for a change of date. However, 3rd shift is not so easy, as it runs from 11:00PM to 7:00AM. So far these are my three conditions:
Code:
If checkModel <> countModel Then
    date_shift_changed = True
End If
If checkShift <> countShift Then
    date_shift_changed = True
End If
If checkDate <> countDate Then
    date_shift_changed = True
End If
I need a condition that does this:

(pseudocode)
If shift = 3 AND [checkDate(current Date) - countDate(date in file) = 1] AND [checkTime(current hour) <> 0 To 6] Then
date_shift_changed = True
End If

Any ideas on how to code that?? Any help is much appreciated!!

Thanks in advance, and Happy Holidays!!

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top