Hi there,
I would be great if anyone help me on below issue:
Table Name: Table1
SCAN_DTTM REPORTED_DTTM
17/12/2013 10:00 27/12/2013 12:00
30/12/2013 09:30 02/01/2014 10:00
18/12/2013 12:00 19/12/2013 16:00
20/12/2013 09:00 20/12/2013 17:00
Table Name: Date
Date Working Day
17/12/2013 Y
18/12/2013 Y
19/12/2013 Y
20/12/2013 Y
21/12/2013 N
22/12/2013 N
23/12/2013 Y
24/12/2013 Y
25/12/2013 B
26/12/2013 B
27/12/2013 Y
28/12/2013 N
29/12/2013 N
30/12/2013 Y
31/12/2013 Y
01/01/2014 B
02/01/2014 Y
03/01/2014 Y
Information:
Mon Tue Wed Thu Fri Comments
09:00 17:30 Standard week(Mon 09:00 to completion time: 17:30 on Friday)
09:00 17:30 Holiday 09:00 17:30 If bank holiday comes(e.g: this week) - 1st Jan 2014 is holiday
09:00 17:30 Holiday Holiday 09:00 - 17:30 If bank holiday comes(e.g: last week) - 25th & 26th Dec' 2013 are holidays
Expected Out come
SCAN_DTTM REPORTED_DTTM Duration(HH:MM:SS)
17/12/2013 10:00 27/12/2013 12:00 115:00:00
30/12/2013 09:30 02/01/2014 10:00 33:00:00
18/12/2013 12:00 19/12/2013 16:00 28:00:00
20/12/2013 09:00 20/12/2013 17:00 08:00
Example calucation:
SCAN_DTTM REPORTED_DTTM
30/12/2013 09:30 02/01/2014 10:00
From 30/12/2013 09:30 to 31/12/2013 (until 17:30) 32 hrs
01/01/2014 is Holiday 0hrs
02/01/2014 from 09:00 to 10:00 is 1 Hr
Net Total 33Hrs
Thanks&Regards
Mohan