wheels0323
Programmer
Code:
CASE WHEN i.TotalWeekHoursMinutes > MRW.MAXHOURSNUM THEN 'Worked more than ' + CAST(CONVERT(DECIMAL(5,2), MRW.MAXHOURSNUM / 60.00) AS VARCHAR(5))+ ' total week hours'
WHEN i.DayTotalMinutes > MRD.MAXHOURSNUM and i.applydate = i.schoolcalendardt THEN 'Worked more than ' + CAST(CONVERT(DECIMAL(5,2), MRD.MAXHOURSNUM / 60.00) AS VARCHAR(5))+ ' hours for one day'
WHEN i.StartDtmHours < MRD.EARLIESTSTARTTM and i.applydate = i.schoolcalendardt THEN 'Started before ' + CAST(CONVERT(DECIMAL(5,2), MRD.EARLIESTSTARTTM /60.00) as varchar(5))--+ ':00'
WHEN i.EndDtmHours > MRD.LATESTENDTM THEN 'Worked passed ' + CAST(MRD.LATESTENDTM / 60 as varchar(5))+ ':00 at night'
ELSE 'No Infraction'
END AS Infraction
In this code above Iam working on this line of code below.
Code:
WHEN i.StartDtmHours < MRD.EARLIESTSTARTTM and i.applydate = i.schoolcalendardt THEN 'Started before ' + CAST(MRD.EARLIESTSTARTTM /60 as varchar(5))+ ':00'
The MRD.EARLIESTSTARTTM field is a numeric value for a 24 hour clock. So, 1a.m. would be 60. 2a.m. would be 120. It's in minutes basically. When it hits Midnight, the value jumps back to zero.
My question is how to write this code differently so that it comes back in hh:mm format. The current way has no decimal. Yet I don't want decimal anyways.
I want it to come back in the 00:00 format. Military time is fine. Any suggestions? I was using some different type of code to do this, but the closest I got
still cut off the last zero of the time.