SQL Developer (MOSC)

MOSC Banner

sum hours per pay period

hello all,

I would like to SUM HOURS_WORKED FOR A EMPLOYEE BASED ON A 7 DAY PAY PERIOD (SUN TO SAT), how can this be done?

PAY PERIOD IS GIVEN AS A PARAMETER. FOR EXAMPLE USER CAN INSERT 23-JAN-2023 TO 27-JAN-2023 OR USER CAN INSERT 23-JAN-2023 TO 30-JAN-2023 etc...


EXAMPLE OUTPUT

IF PAY PERIOD = 23-JAN-2023 TO 27-JAN-2023

EMPLOYEE_NUM '104527' TOTAL_HRS = 23HRS

Employee num   WORK DATE   HOURS_WORKED   Total Hours

104527          23-Jan-23    1             23

104527         25-Jan-23    4             23

104527          26-Jan-23    16             23

104527         27-Jan-23    2             23


IF PAY PERIOD = 23-JAN-2023 TO 30-JAN-2023 TOTAL_HRS = 10 HRS (30th falls in another pay period)

Employee num   WORK DATE   HOURS_WORKED   Total Hours

104527          23-Jan-23    1             23

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center