I have a report in which I need to calculate hours employees worked. The data comes into Crystal as DateTime. Basically the formula assigns a time based on when the employee Clocked In. (Ex. Clock In between 7:50 and 8:08 then 8:00) In the second paragraph of the formula I would like to replace Time({LABOR_TICKET.ACT_CLOCK_IN}) with a formula that adjusts the time to the nearest quarter hour. Ex.
>=8:08 - <8:23 return 8:15
>=8:23 - <8:38 return 8:30
>=8:38 - <8:53 return 8:45
>=8:53 - <9:08 return 9:00
I need this formula for all hours in the day not just the 8 o'clock hour.
If {EMPLOYEE.DEPARTMENT_ID} = "200" and
{LABOR_TICKET.CLOCK_IN} = {LABOR_TICKET.ACT_CLOCK_IN} and
Time({LABOR_TICKET.ACT_CLOCK_IN}) < Time(8,08,00) and
Time({LABOR_TICKET.ACT_CLOCK_IN}) >= Time(7,50,00)
then Time(8,00,00) else
If {EMPLOYEE.DEPARTMENT_ID} = "200" and
{LABOR_TICKET.CLOCK_IN} = {LABOR_TICKET.ACT_CLOCK_IN} and
Time({LABOR_TICKET.ACT_CLOCK_IN}) >= Time(8,08,00)
then Time({LABOR_TICKET.ACT_CLOCK_IN}) else
If {EMPLOYEE.DEPARTMENT_ID} = "200" and
{LABOR_TICKET.CLOCK_IN} <> {LABOR_TICKET.ACT_CLOCK_IN} then
Time({LABOR_TICKET.CLOCK_IN})
Thank you very much for your help!
Hillary
>=8:08 - <8:23 return 8:15
>=8:23 - <8:38 return 8:30
>=8:38 - <8:53 return 8:45
>=8:53 - <9:08 return 9:00
I need this formula for all hours in the day not just the 8 o'clock hour.
If {EMPLOYEE.DEPARTMENT_ID} = "200" and
{LABOR_TICKET.CLOCK_IN} = {LABOR_TICKET.ACT_CLOCK_IN} and
Time({LABOR_TICKET.ACT_CLOCK_IN}) < Time(8,08,00) and
Time({LABOR_TICKET.ACT_CLOCK_IN}) >= Time(7,50,00)
then Time(8,00,00) else
If {EMPLOYEE.DEPARTMENT_ID} = "200" and
{LABOR_TICKET.CLOCK_IN} = {LABOR_TICKET.ACT_CLOCK_IN} and
Time({LABOR_TICKET.ACT_CLOCK_IN}) >= Time(8,08,00)
then Time({LABOR_TICKET.ACT_CLOCK_IN}) else
If {EMPLOYEE.DEPARTMENT_ID} = "200" and
{LABOR_TICKET.CLOCK_IN} <> {LABOR_TICKET.ACT_CLOCK_IN} then
Time({LABOR_TICKET.CLOCK_IN})
Thank you very much for your help!
Hillary