So 3111?
2003, is that 12th January, or 1st November?
That's why I think you should at least use six digit DayCode...
From a six digit day code you can build a date for the StartTime and EndTime:
i.e.
DayCode: 031101 (1st Nov, 2003)
StartTime 22:00
EndTime: 06:00
You can build the date from six digits:
=DateSerial("20" & Left([DayCode], 2), Mid([DayCode], 3, 2), Right([DayCode], 2))
You can build the StartDate:
=CDate(DateSerial("20" & Left([DayCode], 2), Mid([DayCode], 3, 2), Right([DayCode], 2)) + [StartTime])
Therefore, you can alse build the end time:
=CDate(DateAdd("d", 1, DateSerial("20" & Left([DayCode], 2), Mid([DayCode], 3, 2), Right([DayCode], 2))) + [EndTime])
Thus, you can finally get the duration with this big expression.
Duration: DateDiff("h", CDate(DateSerial("20" & Left([DayCode], 2), Mid([DayCode], 3, 2), Right([DayCode], 2)) + [StartTime]), CDate(DateAdd("d", 1, DateSerial("20" & Left([DayCode], 2), Mid([DayCode], 3, 2), Right([DayCode], 2))) + [EndTime]))