This repository has been archived by the owner on Apr 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Presented To Owner Timer.c
53 lines (46 loc) · 3.83 KB
/
Presented To Owner Timer.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* {Presented To Owner Timer}
If {Presented Completed Application to Owner}, Display time difference between {Presented Completed Application to Owner} and {Start Time Business Hours *}.
*
*
*/
IF(
{Presented Completed Application to Owner},
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( {Presented Completed Application to Owner}, 10, 'hour' ) ) > 1,
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( {Presented Completed Application to Owner}, 10, 'hour' ) ) >= 1,
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( {Presented Completed Application to Owner}, 10, 'hour' ) ) >= 3,
( WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( {Presented Completed Application to Owner}, 10, 'hour' ) ) - 2 ) * 36000,
FALSE()
)
) + ( ( 64800 - ( HOUR( DATEADD( {Start Time Business Hours *}, 10, 'hour' ) ) * 3600 ) ) - ( ( MINUTE( {Start Time Business Hours *} ) * 60 ) ) + ( ( HOUR( DATEADD( {Application Tagged As Handed Over}, 10, 'hours' ) ) * 3600 ) - 28800 ) + ( MINUTE( {Presented Completed Application to Owner} ) * 60 ) ),
( ( 64800 - ( HOUR( DATEADD( {Start Time Business Hours *}, 10, 'hour' ) ) * 3600 ) ) - ( ( MINUTE( {Start Time Business Hours *} ) * 60 ) ) + ( ( HOUR( DATEADD( {Application Tagged As Handed Over}, 10, 'hours' ) ) * 3600 ) - 28800 ) + ( MINUTE( {Presented Completed Application to Owner} ) * 60 ) - 36000 )
),
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) > 1,
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) >= 1,
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) >= 3,
( WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) - 2 ) * 36000,
FALSE()
)
) + ( ( 64800 - ( HOUR( DATEADD( {Start Time Business Hours *}, 10, 'hour' ) ) * 3600 ) ) - ( ( MINUTE( {Start Time Business Hours *} ) * 60 ) ) + ( ( HOUR( DATEADD( {Application Tagged As Handed Over}, 10, 'hours' ) ) * 3600 ) - 28800 ) + ( MINUTE( NOW() ) * 60 ) ),
( ( 64800 - ( HOUR( DATEADD( {Start Time Business Hours *}, 10, 'hour' ) ) * 3600 ) ) - ( ( MINUTE( {Start Time Business Hours *} ) * 60 ) ) + ( ( HOUR( DATEADD( {Application Tagged As Handed Over}, 10, 'hours' ) ) * 3600 ) - 28800 ) + ( MINUTE( NOW() ) * 60 ) - 36000 )
)
)
// Make this the business hoursdifferencebetweenn now and Start Time Business Hours.
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) > 1,
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) >= 1,
IF(
WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) >= 3,
( WORKDAY_DIFF( DATEADD( {Start Time Business Hours *}, 10, 'hour' ), DATEADD( NOW(), 10, 'hour' ) ) - 2 ) * 36000,
FALSE()
)
) + ( ( 64800 - ( HOUR( DATEADD( {Start Time Business Hours *}, 10, 'hour' ) ) * 3600 ) ) - ( ( MINUTE( {Start Time Business Hours *} ) * 60 ) ) + ( ( HOUR( DATEADD( {Application Tagged As Handed Over}, 10, 'hours' ) ) * 3600 ) - 28800 ) + ( MINUTE( NOW() ) * 60 ) ),
( ( 64800 - ( HOUR( DATEADD( {Start Time Business Hours *}, 10, 'hour' ) ) * 3600 ) ) - ( ( MINUTE( {Start Time Business Hours *} ) * 60 ) ) + ( ( HOUR( DATEADD( {Application Tagged As Handed Over}, 10, 'hours' ) ) * 3600 ) - 28800 ) + ( MINUTE( NOW() ) * 60 ) - 36000 )
)