A brief overview of what I'm trying to achieve...
The tb_transactions table holds all transactions made by any operator. To track some time and attendance of operators there are two transactions that have Causal_ID's of 2 (Clock-In) and 3 (Clock-Out).
It is possible for an operator to carryout more than one of each type of transaction with a Causal_ID of 2 or 3 within the same trans_date.
I'm trying to put together an Excel spreadsheet that allows a manager to view the time and attendance of the operators.
The manager will want to do the following: -
1) Show period for an operator, showing the first Clock-In and Last Clock-Out by trans_date within the period.
2) as above but all opeators.
3) as 1 & 2 but just for the one day (can still use the period, although the period start & end the same).
I'm trying to get one SQL statement that can be used for all 3 of the above.
Any help or advice appreciated & thanks for taking time out to view.
Regards
The tb_transactions table holds all transactions made by any operator. To track some time and attendance of operators there are two transactions that have Causal_ID's of 2 (Clock-In) and 3 (Clock-Out).
It is possible for an operator to carryout more than one of each type of transaction with a Causal_ID of 2 or 3 within the same trans_date.
I'm trying to put together an Excel spreadsheet that allows a manager to view the time and attendance of the operators.
The manager will want to do the following: -
1) Show period for an operator, showing the first Clock-In and Last Clock-Out by trans_date within the period.
2) as above but all opeators.
3) as 1 & 2 but just for the one day (can still use the period, although the period start & end the same).
I'm trying to get one SQL statement that can be used for all 3 of the above.
Any help or advice appreciated & thanks for taking time out to view.
Regards