Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- T1.MonthPeriod_,
- T1.Fld11302Turnover_,
- T65.Fld12836RRef,
- T65.IDRRef,
- CAST(0.0 AS NUMERIC(21, 2)),
- CAST(0.0 AS NUMERIC(21, 2)),
- T65.IDRRef,
- T65.Description_,
- T65.Description_,
- T65.Fld12836RRef,
- T74._Description,
- 2.0,
- T74._Description
- FROM (SELECT
- DATEADD(DAY,1.0 - 1,DATEADD(MONTH,CAST(DATEPART(MONTH,T2._Period) AS NUMERIC(4)) - 1,DATEADD(YEAR,(CAST(DATEPART(YEAR,T2._Period) AS NUMERIC(4)) - 2000) - 2000,{ts '4000-01-01 00:00:00'}))) AS MonthPeriod_,
- T2._Fld11293_TYPE AS Fld11293_TYPE,
- T2._Fld11293_RTRef AS Fld11293_RTRef,
- T2._Fld11293_RRRef AS Fld11293_RRRef,
- CAST(SUM(T2._Fld11302) AS NUMERIC(33, 8)) AS Fld11302Turnover_
- FROM dbo._AccumRgTn11305 T2
- WHERE (((T2._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Document233 T3
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000E9 AND T2._Fld11293_RRRef = T3._IDRRef) AND (T3._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document212 T4
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D4 AND T2._Fld11293_RRRef = T4._IDRRef) AND (T4._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document234 T5
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000EA AND T2._Fld11293_RRRef = T5._IDRRef) AND (T5._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document263 T6
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x00000107 AND T2._Fld11293_RRRef = T6._IDRRef) AND (T6._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document216 T7
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D8 AND T2._Fld11293_RRRef = T7._IDRRef) AND (T7._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document215 T8
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D7 AND T2._Fld11293_RRRef = T8._IDRRef) AND (T8._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document213 T9
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D5 AND T2._Fld11293_RRRef = T9._IDRRef) AND (T9._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T10
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000C7 AND T2._Fld11293_RRRef = T10._IDRRef) AND (T10._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference42 T11
- ON ((CASE WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000E9 THEN T3._Fld4625RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D4 THEN T4._Fld3516RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000EA THEN T5._Fld4774RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x00000107 THEN T6._Fld6287RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D8 THEN T7._Fld3845RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D7 THEN T8._Fld3734RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D5 THEN T9._Fld3600RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000C7 THEN T10._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = T11._IDRRef)) AND (T11._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T12
- INNER JOIN dbo._Reference21 T13
- ON (((T12._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T14
- WHERE ((T14._Fld595 = ?)) AND ((T14._Fld12065RRef = T12._IDRRef) AND (T14._Fld12066RRef = T13._IDRRef)))) AND T13._IDRRef IN
- (SELECT
- T15._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T15
- INNER JOIN dbo._InfoRg9937 T16
- ON ((T16._Fld9939_TYPE = 0x08 AND T16._Fld9939_RTRef = 0x00000095 AND T16._Fld9939_RRRef = ?) AND (T16._Fld9938_TYPE = T15._Fld784_TYPE AND T16._Fld9938_RTRef = T15._Fld784_RTRef AND T16._Fld9938_RRRef = T15._Fld784_RRRef))
- WHERE ((T15._Fld595 = ?)) AND (T16._Fld595 = ?)))
- WHERE ((T13._Fld595 = ?)) AND ((CASE WHEN T11._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T17
- WHERE ((T17._Fld595 = ?)) AND ((T17._Fld12072RRef = T13._IDRRef) AND (T17._Fld12073_TYPE = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END AND T17._Fld12073_RTRef = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T17._Fld12073_RRRef = T11._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T18
- WHERE ((T18._Fld595 = ?)) AND ((T18._Fld12199RRef = T13._IDRRef) AND T18._Fld12200_TYPE = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END AND T18._Fld12200_RTRef = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T18._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T2._Period >= ? AND T2._Period < ? AND ((T2._Fld11295RRef = ?)) AND (T2._Fld11302 <> ?))
- GROUP BY DATEADD(DAY,1.0 - 1,DATEADD(MONTH,CAST(DATEPART(MONTH,T2._Period) AS NUMERIC(4)) - 1,DATEADD(YEAR,(CAST(DATEPART(YEAR,T2._Period) AS NUMERIC(4)) - 2000) - 2000,{ts '4000-01-01 00:00:00'}))),
- T2._Fld11293_TYPE,
- T2._Fld11293_RTRef,
- T2._Fld11293_RRRef
- HAVING (CAST(SUM(T2._Fld11302) AS NUMERIC(33, 8))) <> 0.0) T1
- LEFT OUTER JOIN (SELECT
- T20._IDRRef AS IDRRef,
- T20._Fld4625RRef AS Fld4625RRef,
- T20._Fld595 AS Fld595_
- FROM dbo._Document233 T20
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T21
- ON ((T20._Fld4625RRef = T21._IDRRef)) AND (T21._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T22
- INNER JOIN dbo._Reference21 T23
- ON (((T22._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T24
- WHERE ((T24._Fld595 = ?)) AND ((T24._Fld12065RRef = T22._IDRRef) AND (T24._Fld12066RRef = T23._IDRRef)))) AND T23._IDRRef IN
- (SELECT
- T25._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T25
- INNER JOIN dbo._InfoRg9937 T26
- ON ((T26._Fld9939_TYPE = 0x08 AND T26._Fld9939_RTRef = 0x00000095 AND T26._Fld9939_RRRef = ?) AND (T26._Fld9938_TYPE = T25._Fld784_TYPE AND T26._Fld9938_RTRef = T25._Fld784_RTRef AND T26._Fld9938_RRRef = T25._Fld784_RRRef))
- WHERE ((T25._Fld595 = ?)) AND (T26._Fld595 = ?)))
- WHERE ((T23._Fld595 = ?)) AND ((CASE WHEN T21._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T27
- WHERE ((T27._Fld595 = ?)) AND ((T27._Fld12072RRef = T23._IDRRef) AND (T27._Fld12073_TYPE = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END AND T27._Fld12073_RTRef = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T27._Fld12073_RRRef = T21._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T28
- WHERE ((T28._Fld595 = ?)) AND ((T28._Fld12199RRef = T23._IDRRef) AND T28._Fld12200_TYPE = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END AND T28._Fld12200_RTRef = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T28._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T20._Fld595 = ?)) T19
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000E9 AND T1.Fld11293_RRRef = T19.IDRRef
- LEFT OUTER JOIN dbo._Document212 T29
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D4 AND T1.Fld11293_RRRef = T29._IDRRef) AND (T29._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T31._IDRRef AS IDRRef,
- T31._Fld4779RRef AS Fld4779RRef,
- T31._Fld595 AS Fld595_,
- T31._Fld4774RRef AS Fld4774RRef
- FROM dbo._Document234 T31
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T32
- ON ((T31._Fld4774RRef = T32._IDRRef)) AND (T32._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T33
- INNER JOIN dbo._Reference21 T34
- ON (((T33._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T35
- WHERE ((T35._Fld595 = ?)) AND ((T35._Fld12065RRef = T33._IDRRef) AND (T35._Fld12066RRef = T34._IDRRef)))) AND T34._IDRRef IN
- (SELECT
- T36._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T36
- INNER JOIN dbo._InfoRg9937 T37
- ON ((T37._Fld9939_TYPE = 0x08 AND T37._Fld9939_RTRef = 0x00000095 AND T37._Fld9939_RRRef = ?) AND (T37._Fld9938_TYPE = T36._Fld784_TYPE AND T37._Fld9938_RTRef = T36._Fld784_RTRef AND T37._Fld9938_RRRef = T36._Fld784_RRRef))
- WHERE ((T36._Fld595 = ?)) AND (T37._Fld595 = ?)))
- WHERE ((T34._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T38
- WHERE ((T38._Fld595 = ?)) AND ((T38._Fld12072RRef = T34._IDRRef) AND (T38._Fld12073_TYPE = 0x08 AND T38._Fld12073_RTRef = 0x0000001C AND T38._Fld12073_RRRef = T31._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T39
- WHERE ((T39._Fld595 = ?)) AND ((T39._Fld12199RRef = T34._IDRRef) AND T39._Fld12200_TYPE = 0x08 AND T39._Fld12200_RTRef = 0x0000001C AND (T39._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T32._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T40
- WHERE ((T40._Fld595 = ?)) AND ((T40._Fld12072RRef = T34._IDRRef) AND (T40._Fld12073_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T40._Fld12073_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T40._Fld12073_RRRef = T32._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T41
- WHERE ((T41._Fld595 = ?)) AND ((T41._Fld12199RRef = T34._IDRRef) AND T41._Fld12200_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T41._Fld12200_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T41._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T31._Fld595 = ?)) T30
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000EA AND T1.Fld11293_RRRef = T30.IDRRef
- LEFT OUTER JOIN dbo._Document263 T42
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x00000107 AND T1.Fld11293_RRRef = T42._IDRRef) AND (T42._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T44._IDRRef AS IDRRef,
- T44._Fld3845RRef AS Fld3845RRef,
- T44._Fld595 AS Fld595_
- FROM dbo._Document216 T44
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T45
- ON ((T44._Fld3845RRef = T45._IDRRef)) AND (T45._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T46
- INNER JOIN dbo._Reference21 T47
- ON (((T46._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T48
- WHERE ((T48._Fld595 = ?)) AND ((T48._Fld12065RRef = T46._IDRRef) AND (T48._Fld12066RRef = T47._IDRRef)))) AND T47._IDRRef IN
- (SELECT
- T49._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T49
- INNER JOIN dbo._InfoRg9937 T50
- ON ((T50._Fld9939_TYPE = 0x08 AND T50._Fld9939_RTRef = 0x00000095 AND T50._Fld9939_RRRef = ?) AND (T50._Fld9938_TYPE = T49._Fld784_TYPE AND T50._Fld9938_RTRef = T49._Fld784_RTRef AND T50._Fld9938_RRRef = T49._Fld784_RRRef))
- WHERE ((T49._Fld595 = ?)) AND (T50._Fld595 = ?)))
- WHERE ((T47._Fld595 = ?)) AND ((CASE WHEN T45._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T51
- WHERE ((T51._Fld595 = ?)) AND ((T51._Fld12072RRef = T47._IDRRef) AND (T51._Fld12073_TYPE = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END AND T51._Fld12073_RTRef = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T51._Fld12073_RRRef = T45._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T52
- WHERE ((T52._Fld595 = ?)) AND ((T52._Fld12199RRef = T47._IDRRef) AND T52._Fld12200_TYPE = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END AND T52._Fld12200_RTRef = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T52._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T44._Fld595 = ?)) T43
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D8 AND T1.Fld11293_RRRef = T43.IDRRef
- LEFT OUTER JOIN (SELECT
- T54._Fld595 AS Fld595_,
- T54._IDRRef AS IDRRef,
- T54._Fld3734RRef AS Fld3734RRef
- FROM dbo._Document215 T54
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T55
- ON ((T54._Fld3734RRef = T55._IDRRef)) AND (T55._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T56
- INNER JOIN dbo._Reference21 T57
- ON (((T56._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T58
- WHERE ((T58._Fld595 = ?)) AND ((T58._Fld12065RRef = T56._IDRRef) AND (T58._Fld12066RRef = T57._IDRRef)))) AND T57._IDRRef IN
- (SELECT
- T59._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T59
- INNER JOIN dbo._InfoRg9937 T60
- ON ((T60._Fld9939_TYPE = 0x08 AND T60._Fld9939_RTRef = 0x00000095 AND T60._Fld9939_RRRef = ?) AND (T60._Fld9938_TYPE = T59._Fld784_TYPE AND T60._Fld9938_RTRef = T59._Fld784_RTRef AND T60._Fld9938_RRRef = T59._Fld784_RRRef))
- WHERE ((T59._Fld595 = ?)) AND (T60._Fld595 = ?)))
- WHERE ((T57._Fld595 = ?)) AND ((CASE WHEN T55._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T61
- WHERE ((T61._Fld595 = ?)) AND ((T61._Fld12072RRef = T57._IDRRef) AND (T61._Fld12073_TYPE = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END AND T61._Fld12073_RTRef = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T61._Fld12073_RRRef = T55._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T62
- WHERE ((T62._Fld595 = ?)) AND ((T62._Fld12199RRef = T57._IDRRef) AND T62._Fld12200_TYPE = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END AND T62._Fld12200_RTRef = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T62._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T54._Fld595 = ?)) T53
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D7 AND T1.Fld11293_RRRef = T53.IDRRef
- LEFT OUTER JOIN dbo._Document213 T63
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D5 AND T1.Fld11293_RRRef = T63._IDRRef) AND (T63._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T64
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000C7 AND T1.Fld11293_RRRef = T64._IDRRef) AND (T64._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T66._IDRRef AS IDRRef,
- T66._Fld12836RRef AS Fld12836RRef,
- T66._Fld595 AS Fld595_,
- T66._Folder AS Folder_,
- T66._Description COLLATE Latin1_General_CI_AS AS Description_
- FROM dbo._Reference42 T66
- WHERE ((T66._IDRRef = ?) AND (((T66._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T67
- INNER JOIN dbo._Reference21 T68
- ON (((T67._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T69
- WHERE ((T69._Fld595 = ?)) AND ((T69._Fld12065RRef = T67._IDRRef) AND (T69._Fld12066RRef = T68._IDRRef)))) AND T68._IDRRef IN
- (SELECT
- T70._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T70
- INNER JOIN dbo._InfoRg9937 T71
- ON ((T71._Fld9939_TYPE = 0x08 AND T71._Fld9939_RTRef = 0x00000095 AND T71._Fld9939_RRRef = ?) AND (T71._Fld9938_TYPE = T70._Fld784_TYPE AND T71._Fld9938_RTRef = T70._Fld784_RTRef AND T71._Fld9938_RRRef = T70._Fld784_RRRef))
- WHERE ((T70._Fld595 = ?)) AND (T71._Fld595 = ?)))
- WHERE ((T68._Fld595 = ?)) AND ((CASE WHEN T66._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T72
- WHERE ((T72._Fld595 = ?)) AND ((T72._Fld12072RRef = T68._IDRRef) AND (T72._Fld12073_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T72._Fld12073_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T72._Fld12073_RRRef = T66._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T73
- WHERE ((T73._Fld595 = ?)) AND ((T73._Fld12199RRef = T68._IDRRef) AND T73._Fld12200_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T73._Fld12200_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T73._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T66._Fld595 = ?)) T65
- ON (CASE WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000E9 THEN T19.Fld4625RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D4 THEN T29._Fld3516RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000EA THEN T30.Fld4774RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x00000107 THEN T42._Fld6287RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D8 THEN T43.Fld3845RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D7 THEN T53.Fld3734RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D5 THEN T63._Fld3600RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000C7 THEN T64._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = T65.IDRRef)
- LEFT OUTER JOIN dbo._Reference28 T74
- ON (T65.Fld12836RRef = T74._IDRRef) AND (T74._Fld595 = ?)
- WHERE (T65.IDRRef = ?)
- UNION ALL SELECT
- DATEADD(DAY,1.0 - 1,DATEADD(MONTH,CAST(DATEPART(MONTH,T97.Date_Time_) AS NUMERIC(4)) - 1,DATEADD(YEAR,(CAST(DATEPART(YEAR,T97.Date_Time_) AS NUMERIC(4)) - 2000) - 2000,?))),
- CAST(0.0 AS NUMERIC(27, 2)),
- T88.Fld12836RRef,
- T88.IDRRef,
- T75.Fld10532Receipt_,
- CAST(0.0 AS NUMERIC(21, 2)),
- T88.IDRRef,
- T88.Description_,
- T88.Description_,
- T88.Fld12836RRef,
- T107._Description,
- 3.0,
- T107._Description
- FROM (SELECT
- T76._RecorderTRef AS RecorderTRef,
- T76._RecorderRRef AS RecorderRRef,
- T76._Fld10530_TYPE AS Fld10530_TYPE,
- T76._Fld10530_RTRef AS Fld10530_RTRef,
- T76._Fld10530_RRRef AS Fld10530_RRRef,
- CAST(SUM(CASE WHEN T76._RecordKind = 0.0 THEN T76._Fld10532 ELSE 0.0 END) AS NUMERIC(27, 8)) AS Fld10532Receipt_
- FROM dbo._AccumRg10527 T76
- WHERE ((T76._Fld595 = ?)) AND (T76._Period <= ? AND T76._Active = 0x01 AND (((T76._Fld10528RRef = ?))) AND T76._RecordKind = ?)
- GROUP BY T76._RecorderTRef,
- T76._RecorderRRef,
- T76._Fld10530_TYPE,
- T76._Fld10530_RTRef,
- T76._Fld10530_RRRef
- HAVING (CAST(SUM(CASE WHEN T76._RecordKind = 0.0 THEN T76._Fld10532 ELSE 0.0 END) AS NUMERIC(27, 8))) <> 0.0) T75
- LEFT OUTER JOIN (SELECT
- T78._IDRRef AS IDRRef,
- T78._Fld3438RRef AS Fld3438RRef,
- T78._Fld595 AS Fld595_
- FROM dbo._Document211 T78
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T79
- ON ((T78._Fld3438RRef = T79._IDRRef)) AND (T79._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T80
- INNER JOIN dbo._Reference21 T81
- ON (((T80._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T82
- WHERE ((T82._Fld595 = ?)) AND ((T82._Fld12065RRef = T80._IDRRef) AND (T82._Fld12066RRef = T81._IDRRef)))) AND T81._IDRRef IN
- (SELECT
- T83._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T83
- INNER JOIN dbo._InfoRg9937 T84
- ON ((T84._Fld9939_TYPE = 0x08 AND T84._Fld9939_RTRef = 0x00000095 AND T84._Fld9939_RRRef = ?) AND (T84._Fld9938_TYPE = T83._Fld784_TYPE AND T84._Fld9938_RTRef = T83._Fld784_RTRef AND T84._Fld9938_RRRef = T83._Fld784_RRRef))
- WHERE ((T83._Fld595 = ?)) AND (T84._Fld595 = ?)))
- WHERE ((T81._Fld595 = ?)) AND ((CASE WHEN T79._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T79._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T85
- WHERE ((T85._Fld595 = ?)) AND ((T85._Fld12072RRef = T81._IDRRef) AND (T85._Fld12073_TYPE = CASE WHEN T79._Fld12836RRef IS NOT NULL THEN 0x08 END AND T85._Fld12073_RTRef = CASE WHEN T79._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T85._Fld12073_RRRef = T79._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T86
- WHERE ((T86._Fld595 = ?)) AND ((T86._Fld12199RRef = T81._IDRRef) AND T86._Fld12200_TYPE = CASE WHEN T79._Fld12836RRef IS NOT NULL THEN 0x08 END AND T86._Fld12200_RTRef = CASE WHEN T79._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T86._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T78._Fld595 = ?)) T77
- ON T75.Fld10530_TYPE = 0x08 AND T75.Fld10530_RTRef = 0x000000D3 AND T75.Fld10530_RRRef = T77.IDRRef
- LEFT OUTER JOIN dbo._Document210 T87
- ON (T75.Fld10530_TYPE = 0x08 AND T75.Fld10530_RTRef = 0x000000D2 AND T75.Fld10530_RRRef = T87._IDRRef) AND (T87._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T89._IDRRef AS IDRRef,
- T89._Fld12836RRef AS Fld12836RRef,
- T89._Fld595 AS Fld595_,
- T89._Folder AS Folder_,
- T89._Description COLLATE Latin1_General_CI_AS AS Description_
- FROM dbo._Reference42 T89
- WHERE ((T89._IDRRef = ?) AND (((T89._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T90
- INNER JOIN dbo._Reference21 T91
- ON (((T90._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T92
- WHERE ((T92._Fld595 = ?)) AND ((T92._Fld12065RRef = T90._IDRRef) AND (T92._Fld12066RRef = T91._IDRRef)))) AND T91._IDRRef IN
- (SELECT
- T93._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T93
- INNER JOIN dbo._InfoRg9937 T94
- ON ((T94._Fld9939_TYPE = 0x08 AND T94._Fld9939_RTRef = 0x00000095 AND T94._Fld9939_RRRef = ?) AND (T94._Fld9938_TYPE = T93._Fld784_TYPE AND T94._Fld9938_RTRef = T93._Fld784_RTRef AND T94._Fld9938_RRRef = T93._Fld784_RRRef))
- WHERE ((T93._Fld595 = ?)) AND (T94._Fld595 = ?)))
- WHERE ((T91._Fld595 = ?)) AND ((CASE WHEN T89._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T89._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T95
- WHERE ((T95._Fld595 = ?)) AND ((T95._Fld12072RRef = T91._IDRRef) AND (T95._Fld12073_TYPE = CASE WHEN T89._Fld12836RRef IS NOT NULL THEN 0x08 END AND T95._Fld12073_RTRef = CASE WHEN T89._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T95._Fld12073_RRRef = T89._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T96
- WHERE ((T96._Fld595 = ?)) AND ((T96._Fld12199RRef = T91._IDRRef) AND T96._Fld12200_TYPE = CASE WHEN T89._Fld12836RRef IS NOT NULL THEN 0x08 END AND T96._Fld12200_RTRef = CASE WHEN T89._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T96._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T89._Fld595 = ?)) T88
- ON (CASE WHEN T75.Fld10530_TYPE = 0x08 AND T75.Fld10530_RTRef = 0x000000D3 THEN T77.Fld3438RRef WHEN T75.Fld10530_TYPE = 0x08 AND T75.Fld10530_RTRef = 0x000000D2 THEN T87._Fld3343RRef ELSE CAST(NULL AS BINARY(16)) END = T88.IDRRef)
- LEFT OUTER JOIN (SELECT
- T98._Date_Time AS Date_Time_,
- T98._IDRRef AS IDRRef,
- T98._Fld3438RRef AS Fld3438RRef,
- T98._Fld595 AS Fld595_,
- T98._Fld3452RRef AS Fld3452RRef
- FROM dbo._Document211 T98
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T99
- ON ((T98._Fld3438RRef = T99._IDRRef)) AND (T99._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T100
- INNER JOIN dbo._Reference21 T101
- ON (((T100._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T102
- WHERE ((T102._Fld595 = ?)) AND ((T102._Fld12065RRef = T100._IDRRef) AND (T102._Fld12066RRef = T101._IDRRef)))) AND T101._IDRRef IN
- (SELECT
- T103._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T103
- INNER JOIN dbo._InfoRg9937 T104
- ON ((T104._Fld9939_TYPE = 0x08 AND T104._Fld9939_RTRef = 0x00000095 AND T104._Fld9939_RRRef = ?) AND (T104._Fld9938_TYPE = T103._Fld784_TYPE AND T104._Fld9938_RTRef = T103._Fld784_RTRef AND T104._Fld9938_RRRef = T103._Fld784_RRRef))
- WHERE ((T103._Fld595 = ?)) AND (T104._Fld595 = ?)))
- WHERE ((T101._Fld595 = ?)) AND ((CASE WHEN T99._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T99._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T105
- WHERE ((T105._Fld595 = ?)) AND ((T105._Fld12072RRef = T101._IDRRef) AND (T105._Fld12073_TYPE = CASE WHEN T99._Fld12836RRef IS NOT NULL THEN 0x08 END AND T105._Fld12073_RTRef = CASE WHEN T99._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T105._Fld12073_RRRef = T99._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T106
- WHERE ((T106._Fld595 = ?)) AND ((T106._Fld12199RRef = T101._IDRRef) AND T106._Fld12200_TYPE = CASE WHEN T99._Fld12836RRef IS NOT NULL THEN 0x08 END AND T106._Fld12200_RTRef = CASE WHEN T99._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T106._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T98._Fld595 = ?)) T97
- ON T75.RecorderTRef = 0x000000D3 AND T75.RecorderRRef = T97.IDRRef
- LEFT OUTER JOIN dbo._Reference28 T107
- ON (T88.Fld12836RRef = T107._IDRRef) AND (T107._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document253 T108
- ON (T75.RecorderTRef = 0x000000FD AND T75.RecorderRRef = T108._IDRRef) AND (T108._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T110._IDRRef AS IDRRef,
- T110._Date_Time AS Date_Time_,
- T110._Fld595 AS Fld595_,
- T110._Fld6155RRef AS Fld6155RRef,
- T110._Fld6139RRef AS Fld6139RRef
- FROM dbo._Document259 T110
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T111
- ON ((T110._Fld6139RRef = T111._IDRRef)) AND (T111._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T112
- INNER JOIN dbo._Reference21 T113
- ON (((T112._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T114
- WHERE ((T114._Fld595 = ?)) AND ((T114._Fld12065RRef = T112._IDRRef) AND (T114._Fld12066RRef = T113._IDRRef)))) AND T113._IDRRef IN
- (SELECT
- T115._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T115
- INNER JOIN dbo._InfoRg9937 T116
- ON ((T116._Fld9939_TYPE = 0x08 AND T116._Fld9939_RTRef = 0x00000095 AND T116._Fld9939_RRRef = ?) AND (T116._Fld9938_TYPE = T115._Fld784_TYPE AND T116._Fld9938_RTRef = T115._Fld784_RTRef AND T116._Fld9938_RRRef = T115._Fld784_RRRef))
- WHERE ((T115._Fld595 = ?)) AND (T116._Fld595 = ?)))
- WHERE ((T113._Fld595 = ?)) AND ((CASE WHEN T111._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T111._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T117
- WHERE ((T117._Fld595 = ?)) AND ((T117._Fld12072RRef = T113._IDRRef) AND (T117._Fld12073_TYPE = CASE WHEN T111._Fld12836RRef IS NOT NULL THEN 0x08 END AND T117._Fld12073_RTRef = CASE WHEN T111._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T117._Fld12073_RRRef = T111._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T118
- WHERE ((T118._Fld595 = ?)) AND ((T118._Fld12199RRef = T113._IDRRef) AND T118._Fld12200_TYPE = CASE WHEN T111._Fld12836RRef IS NOT NULL THEN 0x08 END AND T118._Fld12200_RTRef = CASE WHEN T111._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T118._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T110._Fld595 = ?)) T109
- ON T75.RecorderTRef = 0x00000103 AND T75.RecorderRRef = T109.IDRRef
- LEFT OUTER JOIN (SELECT
- T120._IDRRef AS IDRRef,
- T120._Fld3325_TYPE AS Fld3325_TYPE,
- T120._Fld3325_RTRef AS Fld3325_RTRef,
- T120._Fld3325_RRRef AS Fld3325_RRRef,
- T120._Fld595 AS Fld595_,
- T120._Date_Time AS Date_Time_
- FROM dbo._Document209 T120
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Document211 T121
- ON (T120._Fld3325_TYPE = 0x08 AND T120._Fld3325_RTRef = 0x000000D3 AND T120._Fld3325_RRRef = T121._IDRRef) AND (T121._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document210 T122
- ON (T120._Fld3325_TYPE = 0x08 AND T120._Fld3325_RTRef = 0x000000D2 AND T120._Fld3325_RRRef = T122._IDRRef) AND (T122._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference42 T123
- ON ((CASE WHEN T120._Fld3325_TYPE = 0x08 AND T120._Fld3325_RTRef = 0x000000D3 THEN T121._Fld3438RRef WHEN T120._Fld3325_TYPE = 0x08 AND T120._Fld3325_RTRef = 0x000000D2 THEN T122._Fld3343RRef ELSE CAST(NULL AS BINARY(16)) END = T123._IDRRef)) AND (T123._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T124
- INNER JOIN dbo._Reference21 T125
- ON (((T124._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T126
- WHERE ((T126._Fld595 = ?)) AND ((T126._Fld12065RRef = T124._IDRRef) AND (T126._Fld12066RRef = T125._IDRRef)))) AND T125._IDRRef IN
- (SELECT
- T127._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T127
- INNER JOIN dbo._InfoRg9937 T128
- ON ((T128._Fld9939_TYPE = 0x08 AND T128._Fld9939_RTRef = 0x00000095 AND T128._Fld9939_RRRef = ?) AND (T128._Fld9938_TYPE = T127._Fld784_TYPE AND T128._Fld9938_RTRef = T127._Fld784_RTRef AND T128._Fld9938_RRRef = T127._Fld784_RRRef))
- WHERE ((T127._Fld595 = ?)) AND (T128._Fld595 = ?)))
- WHERE ((T125._Fld595 = ?)) AND ((CASE WHEN T123._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T123._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T129
- WHERE ((T129._Fld595 = ?)) AND ((T129._Fld12072RRef = T125._IDRRef) AND (T129._Fld12073_TYPE = CASE WHEN T123._Fld12836RRef IS NOT NULL THEN 0x08 END AND T129._Fld12073_RTRef = CASE WHEN T123._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T129._Fld12073_RRRef = T123._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T130
- WHERE ((T130._Fld595 = ?)) AND ((T130._Fld12199RRef = T125._IDRRef) AND T130._Fld12200_TYPE = CASE WHEN T123._Fld12836RRef IS NOT NULL THEN 0x08 END AND T130._Fld12200_RTRef = CASE WHEN T123._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T130._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T120._Fld595 = ?)) T119
- ON T75.RecorderTRef = 0x000000D1 AND T75.RecorderRRef = T119.IDRRef
- LEFT OUTER JOIN (SELECT
- T132._Fld5855RRef AS Fld5855RRef,
- T132._IDRRef AS IDRRef,
- T132._Date_Time AS Date_Time_,
- T132._Fld5875RRef AS Fld5875RRef,
- T132._Fld595 AS Fld595_
- FROM dbo._Document255 T132
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T133
- ON ((T132._Fld5855RRef = T133._IDRRef)) AND (T133._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T134
- INNER JOIN dbo._Reference21 T135
- ON (((T134._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T136
- WHERE ((T136._Fld595 = ?)) AND ((T136._Fld12065RRef = T134._IDRRef) AND (T136._Fld12066RRef = T135._IDRRef)))) AND T135._IDRRef IN
- (SELECT
- T137._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T137
- INNER JOIN dbo._InfoRg9937 T138
- ON ((T138._Fld9939_TYPE = 0x08 AND T138._Fld9939_RTRef = 0x00000095 AND T138._Fld9939_RRRef = ?) AND (T138._Fld9938_TYPE = T137._Fld784_TYPE AND T138._Fld9938_RTRef = T137._Fld784_RTRef AND T138._Fld9938_RRRef = T137._Fld784_RRRef))
- WHERE ((T137._Fld595 = ?)) AND (T138._Fld595 = ?)))
- WHERE ((T135._Fld595 = ?)) AND ((CASE WHEN T133._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T139
- WHERE ((T139._Fld595 = ?)) AND ((T139._Fld12072RRef = T135._IDRRef) AND (T139._Fld12073_TYPE = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x08 END AND T139._Fld12073_RTRef = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T139._Fld12073_RRRef = T133._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T140
- WHERE ((T140._Fld595 = ?)) AND ((T140._Fld12199RRef = T135._IDRRef) AND T140._Fld12200_TYPE = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x08 END AND T140._Fld12200_RTRef = CASE WHEN T133._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T140._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T132._Fld595 = ?)) T131
- ON T75.RecorderTRef = 0x000000FF AND T75.RecorderRRef = T131.IDRRef
- LEFT OUTER JOIN dbo._Document210 T141
- ON (T75.RecorderTRef = 0x000000D2 AND T75.RecorderRRef = T141._IDRRef) AND (T141._Fld595 = ?)
- WHERE (CASE WHEN T75.RecorderTRef = 0x000000FD THEN T108._Date_Time WHEN T75.RecorderTRef = 0x00000103 THEN T109.Date_Time_ WHEN T75.RecorderTRef = 0x000000D1 THEN T119.Date_Time_ WHEN T75.RecorderTRef = 0x000000D3 THEN T97.Date_Time_ WHEN T75.RecorderTRef = 0x000000FF THEN T131.Date_Time_ WHEN T75.RecorderTRef = 0x000000D2 THEN T141._Date_Time ELSE CAST(NULL AS DATETIME) END >= ?) AND (CASE WHEN T75.RecorderTRef = 0x000000FD THEN T108._Date_Time WHEN T75.RecorderTRef = 0x00000103 THEN T109.Date_Time_ WHEN T75.RecorderTRef = 0x000000D1 THEN T119.Date_Time_ WHEN T75.RecorderTRef = 0x000000D3 THEN T97.Date_Time_ WHEN T75.RecorderTRef = 0x000000FF THEN T131.Date_Time_ WHEN T75.RecorderTRef = 0x000000D2 THEN T141._Date_Time ELSE CAST(NULL AS DATETIME) END <= ?) AND (CASE WHEN T75.RecorderTRef = 0x000000FD THEN CASE WHEN T108._Fld5746RRef IS NOT NULL THEN 0x000001BE END WHEN T75.RecorderTRef = 0x00000103 THEN CASE WHEN T109.Fld6155RRef IS NOT NULL THEN 0x000001B1 END WHEN T75.RecorderTRef = 0x000000D3 THEN CASE WHEN T97.Fld3452RRef IS NOT NULL THEN 0x000001B4 END WHEN T75.RecorderTRef = 0x000000FF THEN CASE WHEN T131.Fld5875RRef IS NOT NULL THEN 0x000001BF END WHEN T75.RecorderTRef = 0x000000D2 THEN CASE WHEN T141._Fld3367RRef IS NOT NULL THEN 0x000001B3 END ELSE CAST(NULL AS BINARY(4)) END = 0x000001B4 AND CASE WHEN T75.RecorderTRef = 0x000000FD THEN T108._Fld5746RRef WHEN T75.RecorderTRef = 0x00000103 THEN T109.Fld6155RRef WHEN T75.RecorderTRef = 0x000000D3 THEN T97.Fld3452RRef WHEN T75.RecorderTRef = 0x000000FF THEN T131.Fld5875RRef WHEN T75.RecorderTRef = 0x000000D2 THEN T141._Fld3367RRef ELSE CAST(NULL AS BINARY(16)) END IN (?)) AND (T88.IDRRef = ?)
- UNION ALL SELECT
- T142.MonthPeriod_,
- CAST(0.0 AS NUMERIC(27, 2)),
- T192.Fld12836RRef,
- T192.IDRRef,
- T142.Fld10491Receipt_,
- CAST(0.0 AS NUMERIC(21, 2)),
- T192.IDRRef,
- T192.Description_,
- T192.Description_,
- T192.Fld12836RRef,
- T201._Description,
- 4.0,
- T201._Description
- FROM (SELECT
- DATEADD(DAY,1.0 - 1,DATEADD(MONTH,CAST(DATEPART(MONTH,T143._Period) AS NUMERIC(4)) - 1,DATEADD(YEAR,(CAST(DATEPART(YEAR,T143._Period) AS NUMERIC(4)) - 2000) - 2000,{ts '4000-01-01 00:00:00'}))) AS MonthPeriod_,
- T143._RecorderTRef AS RecorderTRef,
- T143._RecorderRRef AS RecorderRRef,
- ISNULL(CAST(CAST(SUM(CASE WHEN T143._RecordKind = 0.0 THEN T143._Fld10491 ELSE 0.0 END) AS NUMERIC(27, 8)) AS NUMERIC(21, 2)),0.0) AS Fld10491Receipt_
- FROM dbo._AccumRg10486 T143
- WHERE (((T143._Fld595 = ?)) AND (EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T144
- INNER JOIN dbo._Reference21 T145
- ON (((T144._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T146
- WHERE ((T146._Fld595 = ?)) AND ((T146._Fld12065RRef = T144._IDRRef) AND (T146._Fld12066RRef = T145._IDRRef)))) AND T145._IDRRef IN
- (SELECT
- T147._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T147
- INNER JOIN dbo._InfoRg9937 T148
- ON ((T148._Fld9939_TYPE = 0x08 AND T148._Fld9939_RTRef = 0x00000095 AND T148._Fld9939_RRRef = ?) AND (T148._Fld9938_TYPE = T147._Fld784_TYPE AND T148._Fld9938_RTRef = T147._Fld784_RTRef AND T148._Fld9938_RRRef = T147._Fld784_RRRef))
- WHERE ((T147._Fld595 = ?)) AND (T148._Fld595 = ?)))
- WHERE ((T145._Fld595 = ?)) AND (CASE WHEN (T143._Fld10489_TYPE = 0x08 AND T143._Fld10489_RTRef = 0x0000006E) THEN CASE WHEN ((T143._Fld10489_TYPE <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T149
- WHERE ((T149._Fld595 = ?)) AND ((T149._Fld12072RRef = T145._IDRRef) AND (T149._Fld12073_TYPE = T143._Fld10489_TYPE AND T149._Fld12073_RTRef = T143._Fld10489_RTRef AND T149._Fld12073_RRRef = T143._Fld10489_RRRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T150
- WHERE ((T150._Fld595 = ?)) AND ((T150._Fld12199RRef = T145._IDRRef) AND T150._Fld12200_TYPE = T143._Fld10489_TYPE AND T150._Fld12200_RTRef = T143._Fld10489_RTRef AND (T150._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)) THEN 0x01 ELSE 0x00 END ELSE 0x00 END) = 0x01))) AND (T143._Period >= ? AND T143._Period <= ? AND T143._Active = 0x01 AND ((T143._Fld10487RRef = ?)) AND T143._RecordKind = ?)
- GROUP BY DATEADD(DAY,1.0 - 1,DATEADD(MONTH,CAST(DATEPART(MONTH,T143._Period) AS NUMERIC(4)) - 1,DATEADD(YEAR,(CAST(DATEPART(YEAR,T143._Period) AS NUMERIC(4)) - 2000) - 2000,{ts '4000-01-01 00:00:00'}))),
- T143._RecorderTRef,
- T143._RecorderRRef
- HAVING (ISNULL(CAST(CAST(SUM(CASE WHEN T143._RecordKind = 0.0 THEN T143._Fld10491 ELSE 0.0 END) AS NUMERIC(27, 8)) AS NUMERIC(21, 2)),0.0)) <> 0.0) T142
- LEFT OUTER JOIN dbo._Document253 T151
- ON (T142.RecorderTRef = 0x000000FD AND T142.RecorderRRef = T151._IDRRef) AND (T151._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T153._IDRRef AS IDRRef,
- T153._Fld595 AS Fld595_,
- T153._Fld6145_TYPE AS Fld6145_TYPE,
- T153._Fld6145_RTRef AS Fld6145_RTRef,
- T153._Fld6145_RRRef AS Fld6145_RRRef,
- T153._Fld6155RRef AS Fld6155RRef,
- T153._Fld6139RRef AS Fld6139RRef
- FROM dbo._Document259 T153
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T154
- ON ((T153._Fld6139RRef = T154._IDRRef)) AND (T154._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T155
- INNER JOIN dbo._Reference21 T156
- ON (((T155._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T157
- WHERE ((T157._Fld595 = ?)) AND ((T157._Fld12065RRef = T155._IDRRef) AND (T157._Fld12066RRef = T156._IDRRef)))) AND T156._IDRRef IN
- (SELECT
- T158._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T158
- INNER JOIN dbo._InfoRg9937 T159
- ON ((T159._Fld9939_TYPE = 0x08 AND T159._Fld9939_RTRef = 0x00000095 AND T159._Fld9939_RRRef = ?) AND (T159._Fld9938_TYPE = T158._Fld784_TYPE AND T159._Fld9938_RTRef = T158._Fld784_RTRef AND T159._Fld9938_RRRef = T158._Fld784_RRRef))
- WHERE ((T158._Fld595 = ?)) AND (T159._Fld595 = ?)))
- WHERE ((T156._Fld595 = ?)) AND ((CASE WHEN T154._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T154._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T160
- WHERE ((T160._Fld595 = ?)) AND ((T160._Fld12072RRef = T156._IDRRef) AND (T160._Fld12073_TYPE = CASE WHEN T154._Fld12836RRef IS NOT NULL THEN 0x08 END AND T160._Fld12073_RTRef = CASE WHEN T154._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T160._Fld12073_RRRef = T154._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T161
- WHERE ((T161._Fld595 = ?)) AND ((T161._Fld12199RRef = T156._IDRRef) AND T161._Fld12200_TYPE = CASE WHEN T154._Fld12836RRef IS NOT NULL THEN 0x08 END AND T161._Fld12200_RTRef = CASE WHEN T154._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T161._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T153._Fld595 = ?)) T152
- ON T142.RecorderTRef = 0x00000103 AND T142.RecorderRRef = T152.IDRRef
- LEFT OUTER JOIN (SELECT
- T163._IDRRef AS IDRRef,
- T163._Fld3273RRef AS Fld3273RRef,
- T163._Fld3279_TYPE AS Fld3279_TYPE,
- T163._Fld3279_RTRef AS Fld3279_RTRef,
- T163._Fld3279_RRRef AS Fld3279_RRRef,
- T163._Fld3289RRef AS Fld3289RRef,
- T163._Fld595 AS Fld595_,
- T163._Fld3291RRef AS Fld3291RRef
- FROM dbo._Document207 T163
- WHERE ((EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T164
- INNER JOIN dbo._Reference21 T165
- ON (((T164._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T166
- WHERE ((T166._Fld595 = ?)) AND ((T166._Fld12065RRef = T164._IDRRef) AND (T166._Fld12066RRef = T165._IDRRef)))) AND T165._IDRRef IN
- (SELECT
- T167._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T167
- INNER JOIN dbo._InfoRg9937 T168
- ON ((T168._Fld9939_TYPE = 0x08 AND T168._Fld9939_RTRef = 0x00000095 AND T168._Fld9939_RRRef = ?) AND (T168._Fld9938_TYPE = T167._Fld784_TYPE AND T168._Fld9938_RTRef = T167._Fld784_RTRef AND T168._Fld9938_RRRef = T167._Fld784_RRRef))
- WHERE ((T167._Fld595 = ?)) AND (T168._Fld595 = ?)))
- WHERE ((T165._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T169
- WHERE ((T169._Fld595 = ?)) AND ((T169._Fld12072RRef = T165._IDRRef) AND (T169._Fld12073_TYPE = 0x08 AND T169._Fld12073_RTRef = 0x0000006E AND T169._Fld12073_RRRef = T163._Fld3289RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T170
- WHERE ((T170._Fld595 = ?)) AND ((T170._Fld12199RRef = T165._IDRRef) AND T170._Fld12200_TYPE = 0x08 AND T170._Fld12200_RTRef = 0x0000006E AND (T170._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T171
- WHERE ((T171._Fld595 = ?)) AND ((T171._Fld12072RRef = T165._IDRRef) AND (T171._Fld12073_TYPE = 0x08 AND T171._Fld12073_RTRef = 0x0000006E AND T171._Fld12073_RRRef = T163._Fld3291RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T172
- WHERE ((T172._Fld595 = ?)) AND ((T172._Fld12199RRef = T165._IDRRef) AND T172._Fld12200_TYPE = 0x08 AND T172._Fld12200_RTRef = 0x0000006E AND (T172._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) AND (T163._Fld595 = ?)) T162
- ON T142.RecorderTRef = 0x000000CF AND T142.RecorderRRef = T162.IDRRef
- LEFT OUTER JOIN (SELECT
- T174._Fld6057_TYPE AS Fld6057_TYPE,
- T174._Fld6057_RTRef AS Fld6057_RTRef,
- T174._Fld6057_RRRef AS Fld6057_RRRef,
- T174._IDRRef AS IDRRef,
- T174._Fld6051RRef AS Fld6051RRef,
- T174._Fld6064RRef AS Fld6064RRef,
- T174._Fld595 AS Fld595_,
- T174._Fld6072RRef AS Fld6072RRef
- FROM dbo._Document258 T174
- WHERE ((EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T175
- INNER JOIN dbo._Reference21 T176
- ON (((T175._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T177
- WHERE ((T177._Fld595 = ?)) AND ((T177._Fld12065RRef = T175._IDRRef) AND (T177._Fld12066RRef = T176._IDRRef)))) AND T176._IDRRef IN
- (SELECT
- T178._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T178
- INNER JOIN dbo._InfoRg9937 T179
- ON ((T179._Fld9939_TYPE = 0x08 AND T179._Fld9939_RTRef = 0x00000095 AND T179._Fld9939_RRRef = ?) AND (T179._Fld9938_TYPE = T178._Fld784_TYPE AND T179._Fld9938_RTRef = T178._Fld784_RTRef AND T179._Fld9938_RRRef = T178._Fld784_RRRef))
- WHERE ((T178._Fld595 = ?)) AND (T179._Fld595 = ?)))
- WHERE ((T176._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T180
- WHERE ((T180._Fld595 = ?)) AND ((T180._Fld12072RRef = T176._IDRRef) AND (T180._Fld12073_TYPE = 0x08 AND T180._Fld12073_RTRef = 0x0000006E AND T180._Fld12073_RRRef = T174._Fld6064RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T181
- WHERE ((T181._Fld595 = ?)) AND ((T181._Fld12199RRef = T176._IDRRef) AND T181._Fld12200_TYPE = 0x08 AND T181._Fld12200_RTRef = 0x0000006E AND (T181._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) AND (T174._Fld595 = ?)) T173
- ON T142.RecorderTRef = 0x00000102 AND T142.RecorderRRef = T173.IDRRef
- LEFT OUTER JOIN (SELECT
- T183._Fld5855RRef AS Fld5855RRef,
- T183._IDRRef AS IDRRef,
- T183._Fld5860_TYPE AS Fld5860_TYPE,
- T183._Fld5860_RTRef AS Fld5860_RTRef,
- T183._Fld5860_RRRef AS Fld5860_RRRef,
- T183._Fld5875RRef AS Fld5875RRef,
- T183._Fld595 AS Fld595_
- FROM dbo._Document255 T183
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T184
- ON ((T183._Fld5855RRef = T184._IDRRef)) AND (T184._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T185
- INNER JOIN dbo._Reference21 T186
- ON (((T185._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T187
- WHERE ((T187._Fld595 = ?)) AND ((T187._Fld12065RRef = T185._IDRRef) AND (T187._Fld12066RRef = T186._IDRRef)))) AND T186._IDRRef IN
- (SELECT
- T188._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T188
- INNER JOIN dbo._InfoRg9937 T189
- ON ((T189._Fld9939_TYPE = 0x08 AND T189._Fld9939_RTRef = 0x00000095 AND T189._Fld9939_RRRef = ?) AND (T189._Fld9938_TYPE = T188._Fld784_TYPE AND T189._Fld9938_RTRef = T188._Fld784_RTRef AND T189._Fld9938_RRRef = T188._Fld784_RRRef))
- WHERE ((T188._Fld595 = ?)) AND (T189._Fld595 = ?)))
- WHERE ((T186._Fld595 = ?)) AND ((CASE WHEN T184._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T184._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T190
- WHERE ((T190._Fld595 = ?)) AND ((T190._Fld12072RRef = T186._IDRRef) AND (T190._Fld12073_TYPE = CASE WHEN T184._Fld12836RRef IS NOT NULL THEN 0x08 END AND T190._Fld12073_RTRef = CASE WHEN T184._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T190._Fld12073_RRRef = T184._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T191
- WHERE ((T191._Fld595 = ?)) AND ((T191._Fld12199RRef = T186._IDRRef) AND T191._Fld12200_TYPE = CASE WHEN T184._Fld12836RRef IS NOT NULL THEN 0x08 END AND T191._Fld12200_RTRef = CASE WHEN T184._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T191._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T183._Fld595 = ?)) T182
- ON T142.RecorderTRef = 0x000000FF AND T142.RecorderRRef = T182.IDRRef
- LEFT OUTER JOIN (SELECT
- T193._IDRRef AS IDRRef,
- T193._Fld12836RRef AS Fld12836RRef,
- T193._Fld595 AS Fld595_,
- T193._Folder AS Folder_,
- T193._Description COLLATE Latin1_General_CI_AS AS Description_
- FROM dbo._Reference42 T193
- WHERE ((T193._IDRRef = ?) AND (((T193._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T194
- INNER JOIN dbo._Reference21 T195
- ON (((T194._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T196
- WHERE ((T196._Fld595 = ?)) AND ((T196._Fld12065RRef = T194._IDRRef) AND (T196._Fld12066RRef = T195._IDRRef)))) AND T195._IDRRef IN
- (SELECT
- T197._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T197
- INNER JOIN dbo._InfoRg9937 T198
- ON ((T198._Fld9939_TYPE = 0x08 AND T198._Fld9939_RTRef = 0x00000095 AND T198._Fld9939_RRRef = ?) AND (T198._Fld9938_TYPE = T197._Fld784_TYPE AND T198._Fld9938_RTRef = T197._Fld784_RTRef AND T198._Fld9938_RRRef = T197._Fld784_RRRef))
- WHERE ((T197._Fld595 = ?)) AND (T198._Fld595 = ?)))
- WHERE ((T195._Fld595 = ?)) AND ((CASE WHEN T193._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T193._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T199
- WHERE ((T199._Fld595 = ?)) AND ((T199._Fld12072RRef = T195._IDRRef) AND (T199._Fld12073_TYPE = CASE WHEN T193._Fld12836RRef IS NOT NULL THEN 0x08 END AND T199._Fld12073_RTRef = CASE WHEN T193._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T199._Fld12073_RRRef = T193._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T200
- WHERE ((T200._Fld595 = ?)) AND ((T200._Fld12199RRef = T195._IDRRef) AND T200._Fld12200_TYPE = CASE WHEN T193._Fld12836RRef IS NOT NULL THEN 0x08 END AND T200._Fld12200_RTRef = CASE WHEN T193._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T200._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T193._Fld595 = ?)) T192
- ON (CASE WHEN T142.RecorderTRef = 0x000000FD THEN T151._Fld5721RRef WHEN T142.RecorderTRef = 0x00000103 THEN T152.Fld6139RRef WHEN T142.RecorderTRef = 0x000000CF THEN T162.Fld3273RRef WHEN T142.RecorderTRef = 0x00000102 THEN T173.Fld6051RRef WHEN T142.RecorderTRef = 0x000000FF THEN T182.Fld5855RRef ELSE CAST(NULL AS BINARY(16)) END = T192.IDRRef)
- LEFT OUTER JOIN dbo._Reference28 T201
- ON (T192.Fld12836RRef = T201._IDRRef) AND (T201._Fld595 = ?)
- WHERE (NOT (((CASE WHEN T142.RecorderTRef = 0x000000FD THEN T151._Fld5727_TYPE WHEN T142.RecorderTRef = 0x00000103 THEN T152.Fld6145_TYPE WHEN T142.RecorderTRef = 0x000000CF THEN T162.Fld3279_TYPE WHEN T142.RecorderTRef = 0x00000102 THEN T173.Fld6057_TYPE WHEN T142.RecorderTRef = 0x000000FF THEN T182.Fld5860_TYPE ELSE CAST(NULL AS BINARY(1)) END = 0x08 AND CASE WHEN T142.RecorderTRef = 0x000000FD THEN T151._Fld5727_RTRef WHEN T142.RecorderTRef = 0x00000103 THEN T152.Fld6145_RTRef WHEN T142.RecorderTRef = 0x000000CF THEN T162.Fld3279_RTRef WHEN T142.RecorderTRef = 0x00000102 THEN T173.Fld6057_RTRef WHEN T142.RecorderTRef = 0x000000FF THEN T182.Fld5860_RTRef ELSE CAST(NULL AS BINARY(4)) END = 0x000000D3)))) AND ((CASE WHEN T142.RecorderTRef = 0x000000FD THEN CASE WHEN T151._Fld5746RRef IS NOT NULL THEN 0x000001BE END WHEN T142.RecorderTRef = 0x00000103 THEN CASE WHEN T152.Fld6155RRef IS NOT NULL THEN 0x000001B1 END WHEN T142.RecorderTRef = 0x00000102 THEN CASE WHEN T173.Fld6072RRef IS NOT NULL THEN 0x000001B0 END WHEN T142.RecorderTRef = 0x000000FF THEN CASE WHEN T182.Fld5875RRef IS NOT NULL THEN 0x000001BF END ELSE CAST(NULL AS BINARY(4)) END = 0x000001BF AND CASE WHEN T142.RecorderTRef = 0x000000FD THEN T151._Fld5746RRef WHEN T142.RecorderTRef = 0x00000103 THEN T152.Fld6155RRef WHEN T142.RecorderTRef = 0x00000102 THEN T173.Fld6072RRef WHEN T142.RecorderTRef = 0x000000FF THEN T182.Fld5875RRef ELSE CAST(NULL AS BINARY(16)) END = ?) OR (CASE WHEN T142.RecorderTRef = 0x000000FD THEN CASE WHEN T151._Fld5746RRef IS NOT NULL THEN 0x000001BE END WHEN T142.RecorderTRef = 0x00000103 THEN CASE WHEN T152.Fld6155RRef IS NOT NULL THEN 0x000001B1 END WHEN T142.RecorderTRef = 0x00000102 THEN CASE WHEN T173.Fld6072RRef IS NOT NULL THEN 0x000001B0 END WHEN T142.RecorderTRef = 0x000000FF THEN CASE WHEN T182.Fld5875RRef IS NOT NULL THEN 0x000001BF END ELSE CAST(NULL AS BINARY(4)) END = 0x000001B1 AND CASE WHEN T142.RecorderTRef = 0x000000FD THEN T151._Fld5746RRef WHEN T142.RecorderTRef = 0x00000103 THEN T152.Fld6155RRef WHEN T142.RecorderTRef = 0x00000102 THEN T173.Fld6072RRef WHEN T142.RecorderTRef = 0x000000FF THEN T182.Fld5875RRef ELSE CAST(NULL AS BINARY(16)) END = ?)) AND (T192.IDRRef = ?)
- UNION ALL SELECT
- DATEADD(DAY,1.0 - 1,DATEADD(MONTH,CAST(DATEPART(MONTH,T224.Date_Time_) AS NUMERIC(4)) - 1,DATEADD(YEAR,(CAST(DATEPART(YEAR,T224.Date_Time_) AS NUMERIC(4)) - 2000) - 2000,?))),
- CAST(0.0 AS NUMERIC(27, 2)),
- T215.Fld12836RRef,
- T215.IDRRef,
- CAST(NULL AS NUMERIC(21, 2)),
- T202.Fld10532Expense_,
- T215.IDRRef,
- T215.Description_,
- T215.Description_,
- T215.Fld12836RRef,
- T236._Description,
- 5.0,
- T236._Description
- FROM (SELECT
- T203._RecorderTRef AS RecorderTRef,
- T203._RecorderRRef AS RecorderRRef,
- T203._Fld10530_TYPE AS Fld10530_TYPE,
- T203._Fld10530_RTRef AS Fld10530_RTRef,
- T203._Fld10530_RRRef AS Fld10530_RRRef,
- CAST(SUM(CASE WHEN T203._RecordKind = 0.0 THEN 0.0 ELSE T203._Fld10532 END) AS NUMERIC(27, 8)) AS Fld10532Expense_
- FROM dbo._AccumRg10527 T203
- WHERE ((T203._Fld595 = ?)) AND (T203._Period <= ? AND T203._Active = 0x01 AND (((T203._Fld10528RRef = ?))) AND T203._RecordKind = ?)
- GROUP BY T203._RecorderTRef,
- T203._RecorderRRef,
- T203._Fld10530_TYPE,
- T203._Fld10530_RTRef,
- T203._Fld10530_RRRef
- HAVING (CAST(SUM(CASE WHEN T203._RecordKind = 0.0 THEN 0.0 ELSE T203._Fld10532 END) AS NUMERIC(27, 8))) <> 0.0) T202
- LEFT OUTER JOIN (SELECT
- T205._IDRRef AS IDRRef,
- T205._Fld3438RRef AS Fld3438RRef,
- T205._Fld595 AS Fld595_
- FROM dbo._Document211 T205
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T206
- ON ((T205._Fld3438RRef = T206._IDRRef)) AND (T206._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T207
- INNER JOIN dbo._Reference21 T208
- ON (((T207._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T209
- WHERE ((T209._Fld595 = ?)) AND ((T209._Fld12065RRef = T207._IDRRef) AND (T209._Fld12066RRef = T208._IDRRef)))) AND T208._IDRRef IN
- (SELECT
- T210._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T210
- INNER JOIN dbo._InfoRg9937 T211
- ON ((T211._Fld9939_TYPE = 0x08 AND T211._Fld9939_RTRef = 0x00000095 AND T211._Fld9939_RRRef = ?) AND (T211._Fld9938_TYPE = T210._Fld784_TYPE AND T211._Fld9938_RTRef = T210._Fld784_RTRef AND T211._Fld9938_RRRef = T210._Fld784_RRRef))
- WHERE ((T210._Fld595 = ?)) AND (T211._Fld595 = ?)))
- WHERE ((T208._Fld595 = ?)) AND ((CASE WHEN T206._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T206._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T212
- WHERE ((T212._Fld595 = ?)) AND ((T212._Fld12072RRef = T208._IDRRef) AND (T212._Fld12073_TYPE = CASE WHEN T206._Fld12836RRef IS NOT NULL THEN 0x08 END AND T212._Fld12073_RTRef = CASE WHEN T206._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T212._Fld12073_RRRef = T206._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T213
- WHERE ((T213._Fld595 = ?)) AND ((T213._Fld12199RRef = T208._IDRRef) AND T213._Fld12200_TYPE = CASE WHEN T206._Fld12836RRef IS NOT NULL THEN 0x08 END AND T213._Fld12200_RTRef = CASE WHEN T206._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T213._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T205._Fld595 = ?)) T204
- ON T202.Fld10530_TYPE = 0x08 AND T202.Fld10530_RTRef = 0x000000D3 AND T202.Fld10530_RRRef = T204.IDRRef
- LEFT OUTER JOIN dbo._Document210 T214
- ON (T202.Fld10530_TYPE = 0x08 AND T202.Fld10530_RTRef = 0x000000D2 AND T202.Fld10530_RRRef = T214._IDRRef) AND (T214._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T216._IDRRef AS IDRRef,
- T216._Fld12836RRef AS Fld12836RRef,
- T216._Fld595 AS Fld595_,
- T216._Folder AS Folder_,
- T216._Description COLLATE Latin1_General_CI_AS AS Description_
- FROM dbo._Reference42 T216
- WHERE ((T216._IDRRef = ?) AND (((T216._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T217
- INNER JOIN dbo._Reference21 T218
- ON (((T217._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T219
- WHERE ((T219._Fld595 = ?)) AND ((T219._Fld12065RRef = T217._IDRRef) AND (T219._Fld12066RRef = T218._IDRRef)))) AND T218._IDRRef IN
- (SELECT
- T220._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T220
- INNER JOIN dbo._InfoRg9937 T221
- ON ((T221._Fld9939_TYPE = 0x08 AND T221._Fld9939_RTRef = 0x00000095 AND T221._Fld9939_RRRef = ?) AND (T221._Fld9938_TYPE = T220._Fld784_TYPE AND T221._Fld9938_RTRef = T220._Fld784_RTRef AND T221._Fld9938_RRRef = T220._Fld784_RRRef))
- WHERE ((T220._Fld595 = ?)) AND (T221._Fld595 = ?)))
- WHERE ((T218._Fld595 = ?)) AND ((CASE WHEN T216._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T216._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T222
- WHERE ((T222._Fld595 = ?)) AND ((T222._Fld12072RRef = T218._IDRRef) AND (T222._Fld12073_TYPE = CASE WHEN T216._Fld12836RRef IS NOT NULL THEN 0x08 END AND T222._Fld12073_RTRef = CASE WHEN T216._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T222._Fld12073_RRRef = T216._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T223
- WHERE ((T223._Fld595 = ?)) AND ((T223._Fld12199RRef = T218._IDRRef) AND T223._Fld12200_TYPE = CASE WHEN T216._Fld12836RRef IS NOT NULL THEN 0x08 END AND T223._Fld12200_RTRef = CASE WHEN T216._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T223._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T216._Fld595 = ?)) T215
- ON (CASE WHEN T202.Fld10530_TYPE = 0x08 AND T202.Fld10530_RTRef = 0x000000D3 THEN T204.Fld3438RRef WHEN T202.Fld10530_TYPE = 0x08 AND T202.Fld10530_RTRef = 0x000000D2 THEN T214._Fld3343RRef ELSE CAST(NULL AS BINARY(16)) END = T215.IDRRef)
- LEFT OUTER JOIN (SELECT
- T225._IDRRef AS IDRRef,
- T225._Fld3325_TYPE AS Fld3325_TYPE,
- T225._Fld3325_RTRef AS Fld3325_RTRef,
- T225._Fld3325_RRRef AS Fld3325_RRRef,
- T225._Fld595 AS Fld595_,
- T225._Date_Time AS Date_Time_
- FROM dbo._Document209 T225
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Document211 T226
- ON (T225._Fld3325_TYPE = 0x08 AND T225._Fld3325_RTRef = 0x000000D3 AND T225._Fld3325_RRRef = T226._IDRRef) AND (T226._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document210 T227
- ON (T225._Fld3325_TYPE = 0x08 AND T225._Fld3325_RTRef = 0x000000D2 AND T225._Fld3325_RRRef = T227._IDRRef) AND (T227._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference42 T228
- ON ((CASE WHEN T225._Fld3325_TYPE = 0x08 AND T225._Fld3325_RTRef = 0x000000D3 THEN T226._Fld3438RRef WHEN T225._Fld3325_TYPE = 0x08 AND T225._Fld3325_RTRef = 0x000000D2 THEN T227._Fld3343RRef ELSE CAST(NULL AS BINARY(16)) END = T228._IDRRef)) AND (T228._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T229
- INNER JOIN dbo._Reference21 T230
- ON (((T229._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T231
- WHERE ((T231._Fld595 = ?)) AND ((T231._Fld12065RRef = T229._IDRRef) AND (T231._Fld12066RRef = T230._IDRRef)))) AND T230._IDRRef IN
- (SELECT
- T232._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T232
- INNER JOIN dbo._InfoRg9937 T233
- ON ((T233._Fld9939_TYPE = 0x08 AND T233._Fld9939_RTRef = 0x00000095 AND T233._Fld9939_RRRef = ?) AND (T233._Fld9938_TYPE = T232._Fld784_TYPE AND T233._Fld9938_RTRef = T232._Fld784_RTRef AND T233._Fld9938_RRRef = T232._Fld784_RRRef))
- WHERE ((T232._Fld595 = ?)) AND (T233._Fld595 = ?)))
- WHERE ((T230._Fld595 = ?)) AND ((CASE WHEN T228._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T228._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T234
- WHERE ((T234._Fld595 = ?)) AND ((T234._Fld12072RRef = T230._IDRRef) AND (T234._Fld12073_TYPE = CASE WHEN T228._Fld12836RRef IS NOT NULL THEN 0x08 END AND T234._Fld12073_RTRef = CASE WHEN T228._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T234._Fld12073_RRRef = T228._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T235
- WHERE ((T235._Fld595 = ?)) AND ((T235._Fld12199RRef = T230._IDRRef) AND T235._Fld12200_TYPE = CASE WHEN T228._Fld12836RRef IS NOT NULL THEN 0x08 END AND T235._Fld12200_RTRef = CASE WHEN T228._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T235._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T225._Fld595 = ?)) T224
- ON T202.RecorderTRef = 0x000000D1 AND T202.RecorderRRef = T224.IDRRef
- LEFT OUTER JOIN dbo._Reference28 T236
- ON (T215.Fld12836RRef = T236._IDRRef) AND (T236._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document253 T237
- ON (T202.RecorderTRef = 0x000000FD AND T202.RecorderRRef = T237._IDRRef) AND (T237._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T239._IDRRef AS IDRRef,
- T239._Date_Time AS Date_Time_,
- T239._Fld595 AS Fld595_,
- T239._Fld6139RRef AS Fld6139RRef
- FROM dbo._Document259 T239
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T240
- ON ((T239._Fld6139RRef = T240._IDRRef)) AND (T240._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T241
- INNER JOIN dbo._Reference21 T242
- ON (((T241._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T243
- WHERE ((T243._Fld595 = ?)) AND ((T243._Fld12065RRef = T241._IDRRef) AND (T243._Fld12066RRef = T242._IDRRef)))) AND T242._IDRRef IN
- (SELECT
- T244._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T244
- INNER JOIN dbo._InfoRg9937 T245
- ON ((T245._Fld9939_TYPE = 0x08 AND T245._Fld9939_RTRef = 0x00000095 AND T245._Fld9939_RRRef = ?) AND (T245._Fld9938_TYPE = T244._Fld784_TYPE AND T245._Fld9938_RTRef = T244._Fld784_RTRef AND T245._Fld9938_RRRef = T244._Fld784_RRRef))
- WHERE ((T244._Fld595 = ?)) AND (T245._Fld595 = ?)))
- WHERE ((T242._Fld595 = ?)) AND ((CASE WHEN T240._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T240._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T246
- WHERE ((T246._Fld595 = ?)) AND ((T246._Fld12072RRef = T242._IDRRef) AND (T246._Fld12073_TYPE = CASE WHEN T240._Fld12836RRef IS NOT NULL THEN 0x08 END AND T246._Fld12073_RTRef = CASE WHEN T240._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T246._Fld12073_RRRef = T240._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T247
- WHERE ((T247._Fld595 = ?)) AND ((T247._Fld12199RRef = T242._IDRRef) AND T247._Fld12200_TYPE = CASE WHEN T240._Fld12836RRef IS NOT NULL THEN 0x08 END AND T247._Fld12200_RTRef = CASE WHEN T240._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T247._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T239._Fld595 = ?)) T238
- ON T202.RecorderTRef = 0x00000103 AND T202.RecorderRRef = T238.IDRRef
- LEFT OUTER JOIN (SELECT
- T249._Date_Time AS Date_Time_,
- T249._IDRRef AS IDRRef,
- T249._Fld3438RRef AS Fld3438RRef,
- T249._Fld595 AS Fld595_
- FROM dbo._Document211 T249
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T250
- ON ((T249._Fld3438RRef = T250._IDRRef)) AND (T250._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T251
- INNER JOIN dbo._Reference21 T252
- ON (((T251._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T253
- WHERE ((T253._Fld595 = ?)) AND ((T253._Fld12065RRef = T251._IDRRef) AND (T253._Fld12066RRef = T252._IDRRef)))) AND T252._IDRRef IN
- (SELECT
- T254._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T254
- INNER JOIN dbo._InfoRg9937 T255
- ON ((T255._Fld9939_TYPE = 0x08 AND T255._Fld9939_RTRef = 0x00000095 AND T255._Fld9939_RRRef = ?) AND (T255._Fld9938_TYPE = T254._Fld784_TYPE AND T255._Fld9938_RTRef = T254._Fld784_RTRef AND T255._Fld9938_RRRef = T254._Fld784_RRRef))
- WHERE ((T254._Fld595 = ?)) AND (T255._Fld595 = ?)))
- WHERE ((T252._Fld595 = ?)) AND ((CASE WHEN T250._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T250._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T256
- WHERE ((T256._Fld595 = ?)) AND ((T256._Fld12072RRef = T252._IDRRef) AND (T256._Fld12073_TYPE = CASE WHEN T250._Fld12836RRef IS NOT NULL THEN 0x08 END AND T256._Fld12073_RTRef = CASE WHEN T250._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T256._Fld12073_RRRef = T250._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T257
- WHERE ((T257._Fld595 = ?)) AND ((T257._Fld12199RRef = T252._IDRRef) AND T257._Fld12200_TYPE = CASE WHEN T250._Fld12836RRef IS NOT NULL THEN 0x08 END AND T257._Fld12200_RTRef = CASE WHEN T250._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T257._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T249._Fld595 = ?)) T248
- ON T202.RecorderTRef = 0x000000D3 AND T202.RecorderRRef = T248.IDRRef
- LEFT OUTER JOIN (SELECT
- T259._Fld5855RRef AS Fld5855RRef,
- T259._IDRRef AS IDRRef,
- T259._Date_Time AS Date_Time_,
- T259._Fld595 AS Fld595_
- FROM dbo._Document255 T259
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T260
- ON ((T259._Fld5855RRef = T260._IDRRef)) AND (T260._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T261
- INNER JOIN dbo._Reference21 T262
- ON (((T261._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T263
- WHERE ((T263._Fld595 = ?)) AND ((T263._Fld12065RRef = T261._IDRRef) AND (T263._Fld12066RRef = T262._IDRRef)))) AND T262._IDRRef IN
- (SELECT
- T264._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T264
- INNER JOIN dbo._InfoRg9937 T265
- ON ((T265._Fld9939_TYPE = 0x08 AND T265._Fld9939_RTRef = 0x00000095 AND T265._Fld9939_RRRef = ?) AND (T265._Fld9938_TYPE = T264._Fld784_TYPE AND T265._Fld9938_RTRef = T264._Fld784_RTRef AND T265._Fld9938_RRRef = T264._Fld784_RRRef))
- WHERE ((T264._Fld595 = ?)) AND (T265._Fld595 = ?)))
- WHERE ((T262._Fld595 = ?)) AND ((CASE WHEN T260._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T260._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T266
- WHERE ((T266._Fld595 = ?)) AND ((T266._Fld12072RRef = T262._IDRRef) AND (T266._Fld12073_TYPE = CASE WHEN T260._Fld12836RRef IS NOT NULL THEN 0x08 END AND T266._Fld12073_RTRef = CASE WHEN T260._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T266._Fld12073_RRRef = T260._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T267
- WHERE ((T267._Fld595 = ?)) AND ((T267._Fld12199RRef = T262._IDRRef) AND T267._Fld12200_TYPE = CASE WHEN T260._Fld12836RRef IS NOT NULL THEN 0x08 END AND T267._Fld12200_RTRef = CASE WHEN T260._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T267._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T259._Fld595 = ?)) T258
- ON T202.RecorderTRef = 0x000000FF AND T202.RecorderRRef = T258.IDRRef
- LEFT OUTER JOIN dbo._Document210 T268
- ON (T202.RecorderTRef = 0x000000D2 AND T202.RecorderRRef = T268._IDRRef) AND (T268._Fld595 = ?)
- WHERE (CASE WHEN T202.RecorderTRef = 0x000000FD THEN T237._Date_Time WHEN T202.RecorderTRef = 0x00000103 THEN T238.Date_Time_ WHEN T202.RecorderTRef = 0x000000D1 THEN T224.Date_Time_ WHEN T202.RecorderTRef = 0x000000D3 THEN T248.Date_Time_ WHEN T202.RecorderTRef = 0x000000FF THEN T258.Date_Time_ WHEN T202.RecorderTRef = 0x000000D2 THEN T268._Date_Time ELSE CAST(NULL AS DATETIME) END >= ?) AND (CASE WHEN T202.RecorderTRef = 0x000000FD THEN T237._Date_Time WHEN T202.RecorderTRef = 0x00000103 THEN T238.Date_Time_ WHEN T202.RecorderTRef = 0x000000D1 THEN T224.Date_Time_ WHEN T202.RecorderTRef = 0x000000D3 THEN T248.Date_Time_ WHEN T202.RecorderTRef = 0x000000FF THEN T258.Date_Time_ WHEN T202.RecorderTRef = 0x000000D2 THEN T268._Date_Time ELSE CAST(NULL AS DATETIME) END <= ?) AND (T202.RecorderTRef = 0x000000D1) AND (T215.IDRRef = ?)
- "
- 17469982=Duration,7=Execs,Sql="INSERT INTO #tt WITH(TABLOCK) (_Q_000_F_000_TYPE, _Q_000_F_000_RTRef, _Q_000_F_000_RRRef, _Q_000_F_001RRef, _Q_000_F_002, _Q_000_F_003RRef, _Q_000_F_004, _Q_000_F_005RRef) SELECT
- T1.Fld11293_TYPE,
- T1.Fld11293_RTRef,
- T1.Fld11293_RRRef,
- T1.Fld11295RRef,
- (T1.Fld11302Turnover_ - T1.Fld11303Turnover_),
- T65.IDRRef,
- CAST(0.0 AS NUMERIC(21, 2)),
- T65.Fld12836RRef
- FROM (SELECT
- T2._Fld11293_TYPE AS Fld11293_TYPE,
- T2._Fld11293_RTRef AS Fld11293_RTRef,
- T2._Fld11293_RRRef AS Fld11293_RRRef,
- T2._Fld11295RRef AS Fld11295RRef,
- CAST(SUM(T2._Fld11303) AS NUMERIC(33, 8)) AS Fld11303Turnover_,
- CAST(SUM(T2._Fld11302) AS NUMERIC(33, 8)) AS Fld11302Turnover_
- FROM dbo._AccumRgTn11305 T2
- WHERE (((T2._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Document233 T3
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000E9 AND T2._Fld11293_RRRef = T3._IDRRef) AND (T3._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document212 T4
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D4 AND T2._Fld11293_RRRef = T4._IDRRef) AND (T4._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document234 T5
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000EA AND T2._Fld11293_RRRef = T5._IDRRef) AND (T5._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document263 T6
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x00000107 AND T2._Fld11293_RRRef = T6._IDRRef) AND (T6._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document216 T7
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D8 AND T2._Fld11293_RRRef = T7._IDRRef) AND (T7._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document215 T8
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D7 AND T2._Fld11293_RRRef = T8._IDRRef) AND (T8._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document213 T9
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D5 AND T2._Fld11293_RRRef = T9._IDRRef) AND (T9._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T10
- ON (T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000C7 AND T2._Fld11293_RRRef = T10._IDRRef) AND (T10._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference42 T11
- ON ((CASE WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000E9 THEN T3._Fld4625RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D4 THEN T4._Fld3516RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000EA THEN T5._Fld4774RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x00000107 THEN T6._Fld6287RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D8 THEN T7._Fld3845RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D7 THEN T8._Fld3734RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000D5 THEN T9._Fld3600RRef WHEN T2._Fld11293_TYPE = 0x08 AND T2._Fld11293_RTRef = 0x000000C7 THEN T10._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = T11._IDRRef)) AND (T11._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T12
- INNER JOIN dbo._Reference21 T13
- ON (((T12._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T14
- WHERE ((T14._Fld595 = ?)) AND ((T14._Fld12065RRef = T12._IDRRef) AND (T14._Fld12066RRef = T13._IDRRef)))) AND T13._IDRRef IN
- (SELECT
- T15._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T15
- INNER JOIN dbo._InfoRg9937 T16
- ON ((T16._Fld9939_TYPE = 0x08 AND T16._Fld9939_RTRef = 0x00000095 AND T16._Fld9939_RRRef = ?) AND (T16._Fld9938_TYPE = T15._Fld784_TYPE AND T16._Fld9938_RTRef = T15._Fld784_RTRef AND T16._Fld9938_RRRef = T15._Fld784_RRRef))
- WHERE ((T15._Fld595 = ?)) AND (T16._Fld595 = ?)))
- WHERE ((T13._Fld595 = ?)) AND ((CASE WHEN T11._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T17
- WHERE ((T17._Fld595 = ?)) AND ((T17._Fld12072RRef = T13._IDRRef) AND (T17._Fld12073_TYPE = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END AND T17._Fld12073_RTRef = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T17._Fld12073_RRRef = T11._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T18
- WHERE ((T18._Fld595 = ?)) AND ((T18._Fld12199RRef = T13._IDRRef) AND T18._Fld12200_TYPE = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x08 END AND T18._Fld12200_RTRef = CASE WHEN T11._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T18._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T2._Period >= ? AND T2._Period < ? AND (T2._Fld11303 <> ? OR T2._Fld11302 <> ?))
- GROUP BY T2._Fld11293_TYPE,
- T2._Fld11293_RTRef,
- T2._Fld11293_RRRef,
- T2._Fld11295RRef
- HAVING (CAST(SUM(T2._Fld11303) AS NUMERIC(33, 8))) <> 0.0 OR (CAST(SUM(T2._Fld11302) AS NUMERIC(33, 8))) <> 0.0) T1
- LEFT OUTER JOIN (SELECT
- T20._IDRRef AS IDRRef,
- T20._Fld4625RRef AS Fld4625RRef,
- T20._Fld595 AS Fld595_
- FROM dbo._Document233 T20
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T21
- ON ((T20._Fld4625RRef = T21._IDRRef)) AND (T21._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T22
- INNER JOIN dbo._Reference21 T23
- ON (((T22._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T24
- WHERE ((T24._Fld595 = ?)) AND ((T24._Fld12065RRef = T22._IDRRef) AND (T24._Fld12066RRef = T23._IDRRef)))) AND T23._IDRRef IN
- (SELECT
- T25._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T25
- INNER JOIN dbo._InfoRg9937 T26
- ON ((T26._Fld9939_TYPE = 0x08 AND T26._Fld9939_RTRef = 0x00000095 AND T26._Fld9939_RRRef = ?) AND (T26._Fld9938_TYPE = T25._Fld784_TYPE AND T26._Fld9938_RTRef = T25._Fld784_RTRef AND T26._Fld9938_RRRef = T25._Fld784_RRRef))
- WHERE ((T25._Fld595 = ?)) AND (T26._Fld595 = ?)))
- WHERE ((T23._Fld595 = ?)) AND ((CASE WHEN T21._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T27
- WHERE ((T27._Fld595 = ?)) AND ((T27._Fld12072RRef = T23._IDRRef) AND (T27._Fld12073_TYPE = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END AND T27._Fld12073_RTRef = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T27._Fld12073_RRRef = T21._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T28
- WHERE ((T28._Fld595 = ?)) AND ((T28._Fld12199RRef = T23._IDRRef) AND T28._Fld12200_TYPE = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x08 END AND T28._Fld12200_RTRef = CASE WHEN T21._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T28._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T20._Fld595 = ?)) T19
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000E9 AND T1.Fld11293_RRRef = T19.IDRRef
- LEFT OUTER JOIN dbo._Document212 T29
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D4 AND T1.Fld11293_RRRef = T29._IDRRef) AND (T29._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T31._IDRRef AS IDRRef,
- T31._Fld4779RRef AS Fld4779RRef,
- T31._Fld595 AS Fld595_,
- T31._Fld4774RRef AS Fld4774RRef
- FROM dbo._Document234 T31
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T32
- ON ((T31._Fld4774RRef = T32._IDRRef)) AND (T32._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T33
- INNER JOIN dbo._Reference21 T34
- ON (((T33._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T35
- WHERE ((T35._Fld595 = ?)) AND ((T35._Fld12065RRef = T33._IDRRef) AND (T35._Fld12066RRef = T34._IDRRef)))) AND T34._IDRRef IN
- (SELECT
- T36._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T36
- INNER JOIN dbo._InfoRg9937 T37
- ON ((T37._Fld9939_TYPE = 0x08 AND T37._Fld9939_RTRef = 0x00000095 AND T37._Fld9939_RRRef = ?) AND (T37._Fld9938_TYPE = T36._Fld784_TYPE AND T37._Fld9938_RTRef = T36._Fld784_RTRef AND T37._Fld9938_RRRef = T36._Fld784_RRRef))
- WHERE ((T36._Fld595 = ?)) AND (T37._Fld595 = ?)))
- WHERE ((T34._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T38
- WHERE ((T38._Fld595 = ?)) AND ((T38._Fld12072RRef = T34._IDRRef) AND (T38._Fld12073_TYPE = 0x08 AND T38._Fld12073_RTRef = 0x0000001C AND T38._Fld12073_RRRef = T31._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T39
- WHERE ((T39._Fld595 = ?)) AND ((T39._Fld12199RRef = T34._IDRRef) AND T39._Fld12200_TYPE = 0x08 AND T39._Fld12200_RTRef = 0x0000001C AND (T39._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T32._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T40
- WHERE ((T40._Fld595 = ?)) AND ((T40._Fld12072RRef = T34._IDRRef) AND (T40._Fld12073_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T40._Fld12073_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T40._Fld12073_RRRef = T32._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T41
- WHERE ((T41._Fld595 = ?)) AND ((T41._Fld12199RRef = T34._IDRRef) AND T41._Fld12200_TYPE = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x08 END AND T41._Fld12200_RTRef = CASE WHEN T32._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T41._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T31._Fld595 = ?)) T30
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000EA AND T1.Fld11293_RRRef = T30.IDRRef
- LEFT OUTER JOIN dbo._Document263 T42
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x00000107 AND T1.Fld11293_RRRef = T42._IDRRef) AND (T42._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T44._IDRRef AS IDRRef,
- T44._Fld3845RRef AS Fld3845RRef,
- T44._Fld595 AS Fld595_
- FROM dbo._Document216 T44
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T45
- ON ((T44._Fld3845RRef = T45._IDRRef)) AND (T45._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T46
- INNER JOIN dbo._Reference21 T47
- ON (((T46._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T48
- WHERE ((T48._Fld595 = ?)) AND ((T48._Fld12065RRef = T46._IDRRef) AND (T48._Fld12066RRef = T47._IDRRef)))) AND T47._IDRRef IN
- (SELECT
- T49._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T49
- INNER JOIN dbo._InfoRg9937 T50
- ON ((T50._Fld9939_TYPE = 0x08 AND T50._Fld9939_RTRef = 0x00000095 AND T50._Fld9939_RRRef = ?) AND (T50._Fld9938_TYPE = T49._Fld784_TYPE AND T50._Fld9938_RTRef = T49._Fld784_RTRef AND T50._Fld9938_RRRef = T49._Fld784_RRRef))
- WHERE ((T49._Fld595 = ?)) AND (T50._Fld595 = ?)))
- WHERE ((T47._Fld595 = ?)) AND ((CASE WHEN T45._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T51
- WHERE ((T51._Fld595 = ?)) AND ((T51._Fld12072RRef = T47._IDRRef) AND (T51._Fld12073_TYPE = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END AND T51._Fld12073_RTRef = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T51._Fld12073_RRRef = T45._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T52
- WHERE ((T52._Fld595 = ?)) AND ((T52._Fld12199RRef = T47._IDRRef) AND T52._Fld12200_TYPE = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x08 END AND T52._Fld12200_RTRef = CASE WHEN T45._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T52._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T44._Fld595 = ?)) T43
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D8 AND T1.Fld11293_RRRef = T43.IDRRef
- LEFT OUTER JOIN (SELECT
- T54._Fld595 AS Fld595_,
- T54._IDRRef AS IDRRef,
- T54._Fld3734RRef AS Fld3734RRef
- FROM dbo._Document215 T54
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T55
- ON ((T54._Fld3734RRef = T55._IDRRef)) AND (T55._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T56
- INNER JOIN dbo._Reference21 T57
- ON (((T56._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T58
- WHERE ((T58._Fld595 = ?)) AND ((T58._Fld12065RRef = T56._IDRRef) AND (T58._Fld12066RRef = T57._IDRRef)))) AND T57._IDRRef IN
- (SELECT
- T59._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T59
- INNER JOIN dbo._InfoRg9937 T60
- ON ((T60._Fld9939_TYPE = 0x08 AND T60._Fld9939_RTRef = 0x00000095 AND T60._Fld9939_RRRef = ?) AND (T60._Fld9938_TYPE = T59._Fld784_TYPE AND T60._Fld9938_RTRef = T59._Fld784_RTRef AND T60._Fld9938_RRRef = T59._Fld784_RRRef))
- WHERE ((T59._Fld595 = ?)) AND (T60._Fld595 = ?)))
- WHERE ((T57._Fld595 = ?)) AND ((CASE WHEN T55._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T61
- WHERE ((T61._Fld595 = ?)) AND ((T61._Fld12072RRef = T57._IDRRef) AND (T61._Fld12073_TYPE = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END AND T61._Fld12073_RTRef = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T61._Fld12073_RRRef = T55._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T62
- WHERE ((T62._Fld595 = ?)) AND ((T62._Fld12199RRef = T57._IDRRef) AND T62._Fld12200_TYPE = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x08 END AND T62._Fld12200_RTRef = CASE WHEN T55._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T62._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T54._Fld595 = ?)) T53
- ON T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D7 AND T1.Fld11293_RRRef = T53.IDRRef
- LEFT OUTER JOIN dbo._Document213 T63
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D5 AND T1.Fld11293_RRRef = T63._IDRRef) AND (T63._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T64
- ON (T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000C7 AND T1.Fld11293_RRRef = T64._IDRRef) AND (T64._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T66._IDRRef AS IDRRef,
- T66._Fld12836RRef AS Fld12836RRef,
- T66._Fld595 AS Fld595_,
- T66._Folder AS Folder_
- FROM dbo._Reference42 T66
- WHERE ((((T66._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T67
- INNER JOIN dbo._Reference21 T68
- ON (((T67._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T69
- WHERE ((T69._Fld595 = ?)) AND ((T69._Fld12065RRef = T67._IDRRef) AND (T69._Fld12066RRef = T68._IDRRef)))) AND T68._IDRRef IN
- (SELECT
- T70._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T70
- INNER JOIN dbo._InfoRg9937 T71
- ON ((T71._Fld9939_TYPE = 0x08 AND T71._Fld9939_RTRef = 0x00000095 AND T71._Fld9939_RRRef = ?) AND (T71._Fld9938_TYPE = T70._Fld784_TYPE AND T71._Fld9938_RTRef = T70._Fld784_RTRef AND T71._Fld9938_RRRef = T70._Fld784_RRRef))
- WHERE ((T70._Fld595 = ?)) AND (T71._Fld595 = ?)))
- WHERE ((T68._Fld595 = ?)) AND ((CASE WHEN T66._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T72
- WHERE ((T72._Fld595 = ?)) AND ((T72._Fld12072RRef = T68._IDRRef) AND (T72._Fld12073_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T72._Fld12073_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T72._Fld12073_RRRef = T66._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T73
- WHERE ((T73._Fld595 = ?)) AND ((T73._Fld12199RRef = T68._IDRRef) AND T73._Fld12200_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T73._Fld12200_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T73._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T66._Fld595 = ?)) T65
- ON (CASE WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000E9 THEN T19.Fld4625RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D4 THEN T29._Fld3516RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000EA THEN T30.Fld4774RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x00000107 THEN T42._Fld6287RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D8 THEN T43.Fld3845RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D7 THEN T53.Fld3734RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000D5 THEN T63._Fld3600RRef WHEN T1.Fld11293_TYPE = 0x08 AND T1.Fld11293_RTRef = 0x000000C7 THEN T64._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = T65.IDRRef)
- UNION ALL SELECT
- T74.Fld10332_TYPE,
- T74.Fld10332_RTRef,
- T74.Fld10332_RRRef,
- T74.Fld10328RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- T74.Fld10330RRef,
- T74.Fld10334Expense_,
- T84.Fld12836RRef
- FROM (SELECT
- T75._RecorderTRef AS RecorderTRef,
- T75._RecorderRRef AS RecorderRRef,
- T75._Fld10332_TYPE AS Fld10332_TYPE,
- T75._Fld10332_RTRef AS Fld10332_RTRef,
- T75._Fld10332_RRRef AS Fld10332_RRRef,
- T75._Fld10328RRef AS Fld10328RRef,
- T75._Fld10330RRef AS Fld10330RRef,
- CAST(SUM(CASE WHEN T75._RecordKind = 0.0 THEN 0.0 ELSE T75._Fld10334 END) AS NUMERIC(27, 8)) AS Fld10334Expense_
- FROM dbo._AccumRg10327 T75
- WHERE (((T75._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T76
- ON ((T75._Fld10330RRef = T76._IDRRef)) AND (T76._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T77
- INNER JOIN dbo._Reference21 T78
- ON (((T77._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T79
- WHERE ((T79._Fld595 = ?)) AND ((T79._Fld12065RRef = T77._IDRRef) AND (T79._Fld12066RRef = T78._IDRRef)))) AND T78._IDRRef IN
- (SELECT
- T80._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T80
- INNER JOIN dbo._InfoRg9937 T81
- ON ((T81._Fld9939_TYPE = 0x08 AND T81._Fld9939_RTRef = 0x00000095 AND T81._Fld9939_RRRef = ?) AND (T81._Fld9938_TYPE = T80._Fld784_TYPE AND T81._Fld9938_RTRef = T80._Fld784_RTRef AND T81._Fld9938_RRRef = T80._Fld784_RRRef))
- WHERE ((T80._Fld595 = ?)) AND (T81._Fld595 = ?)))
- WHERE ((T78._Fld595 = ?)) AND ((CASE WHEN T76._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T76._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T82
- WHERE ((T82._Fld595 = ?)) AND ((T82._Fld12072RRef = T78._IDRRef) AND (T82._Fld12073_TYPE = CASE WHEN T76._Fld12836RRef IS NOT NULL THEN 0x08 END AND T82._Fld12073_RTRef = CASE WHEN T76._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T82._Fld12073_RRRef = T76._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T83
- WHERE ((T83._Fld595 = ?)) AND ((T83._Fld12199RRef = T78._IDRRef) AND T83._Fld12200_TYPE = CASE WHEN T76._Fld12836RRef IS NOT NULL THEN 0x08 END AND T83._Fld12200_RTRef = CASE WHEN T76._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T83._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T75._Period >= ? AND T75._Period <= ? AND T75._Active = 0x01 AND T75._RecordKind = ?)
- GROUP BY T75._RecorderTRef,
- T75._RecorderRRef,
- T75._Fld10332_TYPE,
- T75._Fld10332_RTRef,
- T75._Fld10332_RRRef,
- T75._Fld10328RRef,
- T75._Fld10330RRef
- HAVING (CAST(SUM(CASE WHEN T75._RecordKind = 0.0 THEN 0.0 ELSE T75._Fld10334 END) AS NUMERIC(27, 8))) <> 0.0) T74
- LEFT OUTER JOIN (SELECT
- T85._IDRRef AS IDRRef,
- T85._Fld12836RRef AS Fld12836RRef,
- T85._Fld595 AS Fld595_,
- T85._Folder AS Folder_
- FROM dbo._Reference42 T85
- WHERE ((((T85._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T86
- INNER JOIN dbo._Reference21 T87
- ON (((T86._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T88
- WHERE ((T88._Fld595 = ?)) AND ((T88._Fld12065RRef = T86._IDRRef) AND (T88._Fld12066RRef = T87._IDRRef)))) AND T87._IDRRef IN
- (SELECT
- T89._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T89
- INNER JOIN dbo._InfoRg9937 T90
- ON ((T90._Fld9939_TYPE = 0x08 AND T90._Fld9939_RTRef = 0x00000095 AND T90._Fld9939_RRRef = ?) AND (T90._Fld9938_TYPE = T89._Fld784_TYPE AND T90._Fld9938_RTRef = T89._Fld784_RTRef AND T90._Fld9938_RRRef = T89._Fld784_RRRef))
- WHERE ((T89._Fld595 = ?)) AND (T90._Fld595 = ?)))
- WHERE ((T87._Fld595 = ?)) AND ((CASE WHEN T85._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T91
- WHERE ((T91._Fld595 = ?)) AND ((T91._Fld12072RRef = T87._IDRRef) AND (T91._Fld12073_TYPE = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x08 END AND T91._Fld12073_RTRef = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T91._Fld12073_RRRef = T85._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T92
- WHERE ((T92._Fld595 = ?)) AND ((T92._Fld12199RRef = T87._IDRRef) AND T92._Fld12200_TYPE = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x08 END AND T92._Fld12200_RTRef = CASE WHEN T85._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T92._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T85._Fld595 = ?)) T84
- ON T74.Fld10330RRef = T84.IDRRef
- WHERE (T74.RecorderTRef = 0x000000D3)
- UNION ALL SELECT
- T93.Fld10540_TYPE,
- T93.Fld10540_RTRef,
- T93.Fld10540_RRRef,
- T93.Fld10536RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- T93.Fld10538RRef,
- T93.Fld10544Expense_,
- T103.Fld12836RRef
- FROM (SELECT
- T94._RecorderTRef AS RecorderTRef,
- T94._RecorderRRef AS RecorderRRef,
- T94._Fld10540_TYPE AS Fld10540_TYPE,
- T94._Fld10540_RTRef AS Fld10540_RTRef,
- T94._Fld10540_RRRef AS Fld10540_RRRef,
- T94._Fld10538RRef AS Fld10538RRef,
- T94._Fld10536RRef AS Fld10536RRef,
- CAST(SUM(CASE WHEN T94._RecordKind = 0.0 THEN 0.0 ELSE T94._Fld10544 END) AS NUMERIC(27, 8)) AS Fld10544Expense_
- FROM dbo._AccumRg10535 T94
- WHERE (((T94._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T95
- ON ((T94._Fld10538RRef = T95._IDRRef)) AND (T95._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T96
- INNER JOIN dbo._Reference21 T97
- ON (((T96._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T98
- WHERE ((T98._Fld595 = ?)) AND ((T98._Fld12065RRef = T96._IDRRef) AND (T98._Fld12066RRef = T97._IDRRef)))) AND T97._IDRRef IN
- (SELECT
- T99._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T99
- INNER JOIN dbo._InfoRg9937 T100
- ON ((T100._Fld9939_TYPE = 0x08 AND T100._Fld9939_RTRef = 0x00000095 AND T100._Fld9939_RRRef = ?) AND (T100._Fld9938_TYPE = T99._Fld784_TYPE AND T100._Fld9938_RTRef = T99._Fld784_RTRef AND T100._Fld9938_RRRef = T99._Fld784_RRRef))
- WHERE ((T99._Fld595 = ?)) AND (T100._Fld595 = ?)))
- WHERE ((T97._Fld595 = ?)) AND ((CASE WHEN T95._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T95._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T101
- WHERE ((T101._Fld595 = ?)) AND ((T101._Fld12072RRef = T97._IDRRef) AND (T101._Fld12073_TYPE = CASE WHEN T95._Fld12836RRef IS NOT NULL THEN 0x08 END AND T101._Fld12073_RTRef = CASE WHEN T95._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T101._Fld12073_RRRef = T95._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T102
- WHERE ((T102._Fld595 = ?)) AND ((T102._Fld12199RRef = T97._IDRRef) AND T102._Fld12200_TYPE = CASE WHEN T95._Fld12836RRef IS NOT NULL THEN 0x08 END AND T102._Fld12200_RTRef = CASE WHEN T95._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T102._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T94._Period >= ? AND T94._Period <= ? AND T94._Active = 0x01 AND T94._RecordKind = ?)
- GROUP BY T94._RecorderTRef,
- T94._RecorderRRef,
- T94._Fld10540_TYPE,
- T94._Fld10540_RTRef,
- T94._Fld10540_RRRef,
- T94._Fld10538RRef,
- T94._Fld10536RRef
- HAVING (CAST(SUM(CASE WHEN T94._RecordKind = 0.0 THEN 0.0 ELSE T94._Fld10544 END) AS NUMERIC(27, 8))) <> 0.0) T93
- LEFT OUTER JOIN (SELECT
- T104._IDRRef AS IDRRef,
- T104._Fld12836RRef AS Fld12836RRef,
- T104._Fld595 AS Fld595_,
- T104._Folder AS Folder_
- FROM dbo._Reference42 T104
- WHERE ((((T104._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T105
- INNER JOIN dbo._Reference21 T106
- ON (((T105._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T107
- WHERE ((T107._Fld595 = ?)) AND ((T107._Fld12065RRef = T105._IDRRef) AND (T107._Fld12066RRef = T106._IDRRef)))) AND T106._IDRRef IN
- (SELECT
- T108._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T108
- INNER JOIN dbo._InfoRg9937 T109
- ON ((T109._Fld9939_TYPE = 0x08 AND T109._Fld9939_RTRef = 0x00000095 AND T109._Fld9939_RRRef = ?) AND (T109._Fld9938_TYPE = T108._Fld784_TYPE AND T109._Fld9938_RTRef = T108._Fld784_RTRef AND T109._Fld9938_RRRef = T108._Fld784_RRRef))
- WHERE ((T108._Fld595 = ?)) AND (T109._Fld595 = ?)))
- WHERE ((T106._Fld595 = ?)) AND ((CASE WHEN T104._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T104._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T110
- WHERE ((T110._Fld595 = ?)) AND ((T110._Fld12072RRef = T106._IDRRef) AND (T110._Fld12073_TYPE = CASE WHEN T104._Fld12836RRef IS NOT NULL THEN 0x08 END AND T110._Fld12073_RTRef = CASE WHEN T104._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T110._Fld12073_RRRef = T104._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T111
- WHERE ((T111._Fld595 = ?)) AND ((T111._Fld12199RRef = T106._IDRRef) AND T111._Fld12200_TYPE = CASE WHEN T104._Fld12836RRef IS NOT NULL THEN 0x08 END AND T111._Fld12200_RTRef = CASE WHEN T104._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T111._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T104._Fld595 = ?)) T103
- ON T93.Fld10538RRef = T103.IDRRef
- LEFT OUTER JOIN (SELECT
- T113._IDRRef AS IDRRef,
- T113._Fld4634_TYPE AS Fld4634_TYPE,
- T113._Fld4634_RTRef AS Fld4634_RTRef,
- T113._Fld4634_RRRef AS Fld4634_RRRef,
- T113._Fld4625RRef AS Fld4625RRef,
- T113._Fld595 AS Fld595_
- FROM dbo._Document233 T113
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T114
- ON ((T113._Fld4625RRef = T114._IDRRef)) AND (T114._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T115
- INNER JOIN dbo._Reference21 T116
- ON (((T115._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T117
- WHERE ((T117._Fld595 = ?)) AND ((T117._Fld12065RRef = T115._IDRRef) AND (T117._Fld12066RRef = T116._IDRRef)))) AND T116._IDRRef IN
- (SELECT
- T118._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T118
- INNER JOIN dbo._InfoRg9937 T119
- ON ((T119._Fld9939_TYPE = 0x08 AND T119._Fld9939_RTRef = 0x00000095 AND T119._Fld9939_RRRef = ?) AND (T119._Fld9938_TYPE = T118._Fld784_TYPE AND T119._Fld9938_RTRef = T118._Fld784_RTRef AND T119._Fld9938_RRRef = T118._Fld784_RRRef))
- WHERE ((T118._Fld595 = ?)) AND (T119._Fld595 = ?)))
- WHERE ((T116._Fld595 = ?)) AND ((CASE WHEN T114._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T114._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T120
- WHERE ((T120._Fld595 = ?)) AND ((T120._Fld12072RRef = T116._IDRRef) AND (T120._Fld12073_TYPE = CASE WHEN T114._Fld12836RRef IS NOT NULL THEN 0x08 END AND T120._Fld12073_RTRef = CASE WHEN T114._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T120._Fld12073_RRRef = T114._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T121
- WHERE ((T121._Fld595 = ?)) AND ((T121._Fld12199RRef = T116._IDRRef) AND T121._Fld12200_TYPE = CASE WHEN T114._Fld12836RRef IS NOT NULL THEN 0x08 END AND T121._Fld12200_RTRef = CASE WHEN T114._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T121._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T113._Fld595 = ?)) T112
- ON T93.RecorderTRef = 0x000000E9 AND T93.RecorderRRef = T112.IDRRef
- LEFT OUTER JOIN dbo._Document212 T122
- ON (T93.RecorderTRef = 0x000000D4 AND T93.RecorderRRef = T122._IDRRef) AND (T122._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T124._IDRRef AS IDRRef,
- T124._Fld4779RRef AS Fld4779RRef,
- T124._Fld595 AS Fld595_,
- T124._Fld4782_TYPE AS Fld4782_TYPE,
- T124._Fld4782_RTRef AS Fld4782_RTRef,
- T124._Fld4782_RRRef AS Fld4782_RRRef,
- T124._Fld4774RRef AS Fld4774RRef
- FROM dbo._Document234 T124
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T125
- ON ((T124._Fld4774RRef = T125._IDRRef)) AND (T125._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T126
- INNER JOIN dbo._Reference21 T127
- ON (((T126._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T128
- WHERE ((T128._Fld595 = ?)) AND ((T128._Fld12065RRef = T126._IDRRef) AND (T128._Fld12066RRef = T127._IDRRef)))) AND T127._IDRRef IN
- (SELECT
- T129._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T129
- INNER JOIN dbo._InfoRg9937 T130
- ON ((T130._Fld9939_TYPE = 0x08 AND T130._Fld9939_RTRef = 0x00000095 AND T130._Fld9939_RRRef = ?) AND (T130._Fld9938_TYPE = T129._Fld784_TYPE AND T130._Fld9938_RTRef = T129._Fld784_RTRef AND T130._Fld9938_RRRef = T129._Fld784_RRRef))
- WHERE ((T129._Fld595 = ?)) AND (T130._Fld595 = ?)))
- WHERE ((T127._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T131
- WHERE ((T131._Fld595 = ?)) AND ((T131._Fld12072RRef = T127._IDRRef) AND (T131._Fld12073_TYPE = 0x08 AND T131._Fld12073_RTRef = 0x0000001C AND T131._Fld12073_RRRef = T124._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T132
- WHERE ((T132._Fld595 = ?)) AND ((T132._Fld12199RRef = T127._IDRRef) AND T132._Fld12200_TYPE = 0x08 AND T132._Fld12200_RTRef = 0x0000001C AND (T132._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T125._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T125._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T133
- WHERE ((T133._Fld595 = ?)) AND ((T133._Fld12072RRef = T127._IDRRef) AND (T133._Fld12073_TYPE = CASE WHEN T125._Fld12836RRef IS NOT NULL THEN 0x08 END AND T133._Fld12073_RTRef = CASE WHEN T125._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T133._Fld12073_RRRef = T125._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T134
- WHERE ((T134._Fld595 = ?)) AND ((T134._Fld12199RRef = T127._IDRRef) AND T134._Fld12200_TYPE = CASE WHEN T125._Fld12836RRef IS NOT NULL THEN 0x08 END AND T134._Fld12200_RTRef = CASE WHEN T125._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T134._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T124._Fld595 = ?)) T123
- ON T93.RecorderTRef = 0x000000EA AND T93.RecorderRRef = T123.IDRRef
- LEFT OUTER JOIN dbo._Document253 T135
- ON (T93.RecorderTRef = 0x000000FD AND T93.RecorderRRef = T135._IDRRef) AND (T135._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T137._IDRRef AS IDRRef,
- T137._Fld595 AS Fld595_,
- T137._Fld6145_TYPE AS Fld6145_TYPE,
- T137._Fld6145_RTRef AS Fld6145_RTRef,
- T137._Fld6145_RRRef AS Fld6145_RRRef,
- T137._Fld6139RRef AS Fld6139RRef
- FROM dbo._Document259 T137
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T138
- ON ((T137._Fld6139RRef = T138._IDRRef)) AND (T138._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T139
- INNER JOIN dbo._Reference21 T140
- ON (((T139._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T141
- WHERE ((T141._Fld595 = ?)) AND ((T141._Fld12065RRef = T139._IDRRef) AND (T141._Fld12066RRef = T140._IDRRef)))) AND T140._IDRRef IN
- (SELECT
- T142._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T142
- INNER JOIN dbo._InfoRg9937 T143
- ON ((T143._Fld9939_TYPE = 0x08 AND T143._Fld9939_RTRef = 0x00000095 AND T143._Fld9939_RRRef = ?) AND (T143._Fld9938_TYPE = T142._Fld784_TYPE AND T143._Fld9938_RTRef = T142._Fld784_RTRef AND T143._Fld9938_RRRef = T142._Fld784_RRRef))
- WHERE ((T142._Fld595 = ?)) AND (T143._Fld595 = ?)))
- WHERE ((T140._Fld595 = ?)) AND ((CASE WHEN T138._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T138._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T144
- WHERE ((T144._Fld595 = ?)) AND ((T144._Fld12072RRef = T140._IDRRef) AND (T144._Fld12073_TYPE = CASE WHEN T138._Fld12836RRef IS NOT NULL THEN 0x08 END AND T144._Fld12073_RTRef = CASE WHEN T138._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T144._Fld12073_RRRef = T138._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T145
- WHERE ((T145._Fld595 = ?)) AND ((T145._Fld12199RRef = T140._IDRRef) AND T145._Fld12200_TYPE = CASE WHEN T138._Fld12836RRef IS NOT NULL THEN 0x08 END AND T145._Fld12200_RTRef = CASE WHEN T138._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T145._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T137._Fld595 = ?)) T136
- ON T93.RecorderTRef = 0x00000103 AND T93.RecorderRRef = T136.IDRRef
- LEFT OUTER JOIN (SELECT
- T147._IDRRef AS IDRRef,
- T147._Fld3845RRef AS Fld3845RRef,
- T147._Fld3852_TYPE AS Fld3852_TYPE,
- T147._Fld3852_RTRef AS Fld3852_RTRef,
- T147._Fld3852_RRRef AS Fld3852_RRRef,
- T147._Fld595 AS Fld595_
- FROM dbo._Document216 T147
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T148
- ON ((T147._Fld3845RRef = T148._IDRRef)) AND (T148._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T149
- INNER JOIN dbo._Reference21 T150
- ON (((T149._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T151
- WHERE ((T151._Fld595 = ?)) AND ((T151._Fld12065RRef = T149._IDRRef) AND (T151._Fld12066RRef = T150._IDRRef)))) AND T150._IDRRef IN
- (SELECT
- T152._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T152
- INNER JOIN dbo._InfoRg9937 T153
- ON ((T153._Fld9939_TYPE = 0x08 AND T153._Fld9939_RTRef = 0x00000095 AND T153._Fld9939_RRRef = ?) AND (T153._Fld9938_TYPE = T152._Fld784_TYPE AND T153._Fld9938_RTRef = T152._Fld784_RTRef AND T153._Fld9938_RRRef = T152._Fld784_RRRef))
- WHERE ((T152._Fld595 = ?)) AND (T153._Fld595 = ?)))
- WHERE ((T150._Fld595 = ?)) AND ((CASE WHEN T148._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T148._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T154
- WHERE ((T154._Fld595 = ?)) AND ((T154._Fld12072RRef = T150._IDRRef) AND (T154._Fld12073_TYPE = CASE WHEN T148._Fld12836RRef IS NOT NULL THEN 0x08 END AND T154._Fld12073_RTRef = CASE WHEN T148._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T154._Fld12073_RRRef = T148._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T155
- WHERE ((T155._Fld595 = ?)) AND ((T155._Fld12199RRef = T150._IDRRef) AND T155._Fld12200_TYPE = CASE WHEN T148._Fld12836RRef IS NOT NULL THEN 0x08 END AND T155._Fld12200_RTRef = CASE WHEN T148._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T155._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T147._Fld595 = ?)) T146
- ON T93.RecorderTRef = 0x000000D8 AND T93.RecorderRRef = T146.IDRRef
- LEFT OUTER JOIN (SELECT
- T157._IDRRef AS IDRRef,
- T157._Fld3325_TYPE AS Fld3325_TYPE,
- T157._Fld3325_RTRef AS Fld3325_RTRef,
- T157._Fld3325_RRRef AS Fld3325_RRRef,
- T157._Fld595 AS Fld595_
- FROM dbo._Document209 T157
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Document211 T158
- ON (T157._Fld3325_TYPE = 0x08 AND T157._Fld3325_RTRef = 0x000000D3 AND T157._Fld3325_RRRef = T158._IDRRef) AND (T158._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document210 T159
- ON (T157._Fld3325_TYPE = 0x08 AND T157._Fld3325_RTRef = 0x000000D2 AND T157._Fld3325_RRRef = T159._IDRRef) AND (T159._Fld595 = ?)
- LEFT OUTER JOIN dbo._Reference42 T160
- ON ((CASE WHEN T157._Fld3325_TYPE = 0x08 AND T157._Fld3325_RTRef = 0x000000D3 THEN T158._Fld3438RRef WHEN T157._Fld3325_TYPE = 0x08 AND T157._Fld3325_RTRef = 0x000000D2 THEN T159._Fld3343RRef ELSE CAST(NULL AS BINARY(16)) END = T160._IDRRef)) AND (T160._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T161
- INNER JOIN dbo._Reference21 T162
- ON (((T161._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T163
- WHERE ((T163._Fld595 = ?)) AND ((T163._Fld12065RRef = T161._IDRRef) AND (T163._Fld12066RRef = T162._IDRRef)))) AND T162._IDRRef IN
- (SELECT
- T164._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T164
- INNER JOIN dbo._InfoRg9937 T165
- ON ((T165._Fld9939_TYPE = 0x08 AND T165._Fld9939_RTRef = 0x00000095 AND T165._Fld9939_RRRef = ?) AND (T165._Fld9938_TYPE = T164._Fld784_TYPE AND T165._Fld9938_RTRef = T164._Fld784_RTRef AND T165._Fld9938_RRRef = T164._Fld784_RRRef))
- WHERE ((T164._Fld595 = ?)) AND (T165._Fld595 = ?)))
- WHERE ((T162._Fld595 = ?)) AND ((CASE WHEN T160._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T160._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T166
- WHERE ((T166._Fld595 = ?)) AND ((T166._Fld12072RRef = T162._IDRRef) AND (T166._Fld12073_TYPE = CASE WHEN T160._Fld12836RRef IS NOT NULL THEN 0x08 END AND T166._Fld12073_RTRef = CASE WHEN T160._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T166._Fld12073_RRRef = T160._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T167
- WHERE ((T167._Fld595 = ?)) AND ((T167._Fld12199RRef = T162._IDRRef) AND T167._Fld12200_TYPE = CASE WHEN T160._Fld12836RRef IS NOT NULL THEN 0x08 END AND T167._Fld12200_RTRef = CASE WHEN T160._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T167._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T157._Fld595 = ?)) T156
- ON T93.RecorderTRef = 0x000000D1 AND T93.RecorderRRef = T156.IDRRef
- LEFT OUTER JOIN (SELECT
- T169._Fld595 AS Fld595_,
- T169._IDRRef AS IDRRef,
- T169._Fld3734RRef AS Fld3734RRef,
- T169._Fld3739RRef AS Fld3739RRef
- FROM dbo._Document215 T169
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T170
- ON ((T169._Fld3734RRef = T170._IDRRef)) AND (T170._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T171
- INNER JOIN dbo._Reference21 T172
- ON (((T171._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T173
- WHERE ((T173._Fld595 = ?)) AND ((T173._Fld12065RRef = T171._IDRRef) AND (T173._Fld12066RRef = T172._IDRRef)))) AND T172._IDRRef IN
- (SELECT
- T174._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T174
- INNER JOIN dbo._InfoRg9937 T175
- ON ((T175._Fld9939_TYPE = 0x08 AND T175._Fld9939_RTRef = 0x00000095 AND T175._Fld9939_RRRef = ?) AND (T175._Fld9938_TYPE = T174._Fld784_TYPE AND T175._Fld9938_RTRef = T174._Fld784_RTRef AND T175._Fld9938_RRRef = T174._Fld784_RRRef))
- WHERE ((T174._Fld595 = ?)) AND (T175._Fld595 = ?)))
- WHERE ((T172._Fld595 = ?)) AND ((CASE WHEN T170._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T170._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T176
- WHERE ((T176._Fld595 = ?)) AND ((T176._Fld12072RRef = T172._IDRRef) AND (T176._Fld12073_TYPE = CASE WHEN T170._Fld12836RRef IS NOT NULL THEN 0x08 END AND T176._Fld12073_RTRef = CASE WHEN T170._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T176._Fld12073_RRRef = T170._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T177
- WHERE ((T177._Fld595 = ?)) AND ((T177._Fld12199RRef = T172._IDRRef) AND T177._Fld12200_TYPE = CASE WHEN T170._Fld12836RRef IS NOT NULL THEN 0x08 END AND T177._Fld12200_RTRef = CASE WHEN T170._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T177._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T169._Fld595 = ?)) T168
- ON T93.RecorderTRef = 0x000000D7 AND T93.RecorderRRef = T168.IDRRef
- LEFT OUTER JOIN (SELECT
- T179._Fld6057_TYPE AS Fld6057_TYPE,
- T179._Fld6057_RTRef AS Fld6057_RTRef,
- T179._Fld6057_RRRef AS Fld6057_RRRef,
- T179._IDRRef AS IDRRef,
- T179._Fld6064RRef AS Fld6064RRef,
- T179._Fld595 AS Fld595_
- FROM dbo._Document258 T179
- WHERE ((EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T180
- INNER JOIN dbo._Reference21 T181
- ON (((T180._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T182
- WHERE ((T182._Fld595 = ?)) AND ((T182._Fld12065RRef = T180._IDRRef) AND (T182._Fld12066RRef = T181._IDRRef)))) AND T181._IDRRef IN
- (SELECT
- T183._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T183
- INNER JOIN dbo._InfoRg9937 T184
- ON ((T184._Fld9939_TYPE = 0x08 AND T184._Fld9939_RTRef = 0x00000095 AND T184._Fld9939_RRRef = ?) AND (T184._Fld9938_TYPE = T183._Fld784_TYPE AND T184._Fld9938_RTRef = T183._Fld784_RTRef AND T184._Fld9938_RRRef = T183._Fld784_RRRef))
- WHERE ((T183._Fld595 = ?)) AND (T184._Fld595 = ?)))
- WHERE ((T181._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T185
- WHERE ((T185._Fld595 = ?)) AND ((T185._Fld12072RRef = T181._IDRRef) AND (T185._Fld12073_TYPE = 0x08 AND T185._Fld12073_RTRef = 0x0000006E AND T185._Fld12073_RRRef = T179._Fld6064RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T186
- WHERE ((T186._Fld595 = ?)) AND ((T186._Fld12199RRef = T181._IDRRef) AND T186._Fld12200_TYPE = 0x08 AND T186._Fld12200_RTRef = 0x0000006E AND (T186._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) AND (T179._Fld595 = ?)) T178
- ON T93.RecorderTRef = 0x00000102 AND T93.RecorderRRef = T178.IDRRef
- LEFT OUTER JOIN (SELECT
- T188._IDRRef AS IDRRef,
- T188._Fld3438RRef AS Fld3438RRef,
- T188._Fld3444_TYPE AS Fld3444_TYPE,
- T188._Fld3444_RTRef AS Fld3444_RTRef,
- T188._Fld3444_RRRef AS Fld3444_RRRef,
- T188._Fld595 AS Fld595_
- FROM dbo._Document211 T188
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T189
- ON ((T188._Fld3438RRef = T189._IDRRef)) AND (T189._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T190
- INNER JOIN dbo._Reference21 T191
- ON (((T190._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T192
- WHERE ((T192._Fld595 = ?)) AND ((T192._Fld12065RRef = T190._IDRRef) AND (T192._Fld12066RRef = T191._IDRRef)))) AND T191._IDRRef IN
- (SELECT
- T193._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T193
- INNER JOIN dbo._InfoRg9937 T194
- ON ((T194._Fld9939_TYPE = 0x08 AND T194._Fld9939_RTRef = 0x00000095 AND T194._Fld9939_RRRef = ?) AND (T194._Fld9938_TYPE = T193._Fld784_TYPE AND T194._Fld9938_RTRef = T193._Fld784_RTRef AND T194._Fld9938_RRRef = T193._Fld784_RRRef))
- WHERE ((T193._Fld595 = ?)) AND (T194._Fld595 = ?)))
- WHERE ((T191._Fld595 = ?)) AND ((CASE WHEN T189._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T189._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T195
- WHERE ((T195._Fld595 = ?)) AND ((T195._Fld12072RRef = T191._IDRRef) AND (T195._Fld12073_TYPE = CASE WHEN T189._Fld12836RRef IS NOT NULL THEN 0x08 END AND T195._Fld12073_RTRef = CASE WHEN T189._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T195._Fld12073_RRRef = T189._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T196
- WHERE ((T196._Fld595 = ?)) AND ((T196._Fld12199RRef = T191._IDRRef) AND T196._Fld12200_TYPE = CASE WHEN T189._Fld12836RRef IS NOT NULL THEN 0x08 END AND T196._Fld12200_RTRef = CASE WHEN T189._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T196._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T188._Fld595 = ?)) T187
- ON T93.RecorderTRef = 0x000000D3 AND T93.RecorderRRef = T187.IDRRef
- LEFT OUTER JOIN dbo._Document248 T197
- ON (T93.RecorderTRef = 0x000000F8 AND T93.RecorderRRef = T197._IDRRef) AND (T197._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- T199._Fld5855RRef AS Fld5855RRef,
- T199._IDRRef AS IDRRef,
- T199._Fld5860_TYPE AS Fld5860_TYPE,
- T199._Fld5860_RTRef AS Fld5860_RTRef,
- T199._Fld5860_RRRef AS Fld5860_RRRef,
- T199._Fld595 AS Fld595_
- FROM dbo._Document255 T199
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T200
- ON ((T199._Fld5855RRef = T200._IDRRef)) AND (T200._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T201
- INNER JOIN dbo._Reference21 T202
- ON (((T201._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T203
- WHERE ((T203._Fld595 = ?)) AND ((T203._Fld12065RRef = T201._IDRRef) AND (T203._Fld12066RRef = T202._IDRRef)))) AND T202._IDRRef IN
- (SELECT
- T204._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T204
- INNER JOIN dbo._InfoRg9937 T205
- ON ((T205._Fld9939_TYPE = 0x08 AND T205._Fld9939_RTRef = 0x00000095 AND T205._Fld9939_RRRef = ?) AND (T205._Fld9938_TYPE = T204._Fld784_TYPE AND T205._Fld9938_RTRef = T204._Fld784_RTRef AND T205._Fld9938_RRRef = T204._Fld784_RRRef))
- WHERE ((T204._Fld595 = ?)) AND (T205._Fld595 = ?)))
- WHERE ((T202._Fld595 = ?)) AND ((CASE WHEN T200._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T200._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T206
- WHERE ((T206._Fld595 = ?)) AND ((T206._Fld12072RRef = T202._IDRRef) AND (T206._Fld12073_TYPE = CASE WHEN T200._Fld12836RRef IS NOT NULL THEN 0x08 END AND T206._Fld12073_RTRef = CASE WHEN T200._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T206._Fld12073_RRRef = T200._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T207
- WHERE ((T207._Fld595 = ?)) AND ((T207._Fld12199RRef = T202._IDRRef) AND T207._Fld12200_TYPE = CASE WHEN T200._Fld12836RRef IS NOT NULL THEN 0x08 END AND T207._Fld12200_RTRef = CASE WHEN T200._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T207._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T199._Fld595 = ?)) T198
- ON T93.RecorderTRef = 0x000000FF AND T93.RecorderRRef = T198.IDRRef
- LEFT OUTER JOIN dbo._Document210 T208
- ON (T93.RecorderTRef = 0x000000D2 AND T93.RecorderRRef = T208._IDRRef) AND (T208._Fld595 = ?)
- WHERE (NOT (((CASE WHEN T93.RecorderTRef = 0x000000E9 THEN T112.Fld4634_TYPE WHEN T93.RecorderTRef = 0x000000D4 THEN CASE WHEN T122._Fld3521RRef IS NOT NULL THEN 0x08 END WHEN T93.RecorderTRef = 0x000000EA THEN T123.Fld4782_TYPE WHEN T93.RecorderTRef = 0x000000FD THEN T135._Fld5727_TYPE WHEN T93.RecorderTRef = 0x00000103 THEN T136.Fld6145_TYPE WHEN T93.RecorderTRef = 0x000000D8 THEN T146.Fld3852_TYPE WHEN T93.RecorderTRef = 0x000000D1 THEN T156.Fld3325_TYPE WHEN T93.RecorderTRef = 0x000000D7 THEN CASE WHEN T168.Fld3739RRef IS NOT NULL THEN 0x08 END WHEN T93.RecorderTRef = 0x00000102 THEN T178.Fld6057_TYPE WHEN T93.RecorderTRef = 0x000000D3 THEN T187.Fld3444_TYPE WHEN T93.RecorderTRef = 0x000000F8 THEN CASE WHEN T197._Fld5366RRef IS NOT NULL THEN 0x08 END WHEN T93.RecorderTRef = 0x000000FF THEN T198.Fld5860_TYPE WHEN T93.RecorderTRef = 0x000000D2 THEN T208._Fld3350_TYPE ELSE CAST(NULL AS BINARY(1)) END = 0x08 AND CASE WHEN T93.RecorderTRef = 0x000000E9 THEN T112.Fld4634_RTRef WHEN T93.RecorderTRef = 0x000000D4 THEN CASE WHEN T122._Fld3521RRef IS NOT NULL THEN 0x000000E9 END WHEN T93.RecorderTRef = 0x000000EA THEN T123.Fld4782_RTRef WHEN T93.RecorderTRef = 0x000000FD THEN T135._Fld5727_RTRef WHEN T93.RecorderTRef = 0x00000103 THEN T136.Fld6145_RTRef WHEN T93.RecorderTRef = 0x000000D8 THEN T146.Fld3852_RTRef WHEN T93.RecorderTRef = 0x000000D1 THEN T156.Fld3325_RTRef WHEN T93.RecorderTRef = 0x000000D7 THEN CASE WHEN T168.Fld3739RRef IS NOT NULL THEN 0x000000E9 END WHEN T93.RecorderTRef = 0x00000102 THEN T178.Fld6057_RTRef WHEN T93.RecorderTRef = 0x000000D3 THEN T187.Fld3444_RTRef WHEN T93.RecorderTRef = 0x000000F8 THEN CASE WHEN T197._Fld5366RRef IS NOT NULL THEN 0x000000F9 END WHEN T93.RecorderTRef = 0x000000FF THEN T198.Fld5860_RTRef WHEN T93.RecorderTRef = 0x000000D2 THEN T208._Fld3350_RTRef ELSE CAST(NULL AS BINARY(4)) END = 0x000000D3)))) AND ((T93.RecorderTRef = 0x00000103) OR (T93.RecorderTRef = 0x000000FF))
- UNION ALL SELECT
- T209.Fld10332_TYPE,
- T209.Fld10332_RTRef,
- T209.Fld10332_RRRef,
- T209.Fld10328RRef,
- CAST(NULL AS NUMERIC(28, 2)),
- T209.Fld10330RRef,
- CAST(NULL AS NUMERIC(21, 2)),
- T219.Fld12836RRef
- FROM (SELECT
- T210._RecorderTRef AS RecorderTRef,
- T210._RecorderRRef AS RecorderRRef,
- T210._Fld10332_TYPE AS Fld10332_TYPE,
- T210._Fld10332_RTRef AS Fld10332_RTRef,
- T210._Fld10332_RRRef AS Fld10332_RRRef,
- T210._Fld10328RRef AS Fld10328RRef,
- T210._Fld10330RRef AS Fld10330RRef,
- CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN T210._Fld10334 ELSE 0.0 END) AS NUMERIC(27, 8)) AS Fld10334Receipt_,
- CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN 0.0 ELSE T210._Fld10334 END) AS NUMERIC(27, 8)) AS Fld10334Expense_,
- CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN T210._Fld10335 ELSE 0.0 END) AS NUMERIC(27, 8)) AS Fld10335Receipt_,
- CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN 0.0 ELSE T210._Fld10335 END) AS NUMERIC(27, 8)) AS Fld10335Expense_
- FROM dbo._AccumRg10327 T210
- WHERE (((T210._Fld595 = ?)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T211
- ON ((T210._Fld10330RRef = T211._IDRRef)) AND (T211._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T212
- INNER JOIN dbo._Reference21 T213
- ON (((T212._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T214
- WHERE ((T214._Fld595 = ?)) AND ((T214._Fld12065RRef = T212._IDRRef) AND (T214._Fld12066RRef = T213._IDRRef)))) AND T213._IDRRef IN
- (SELECT
- T215._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T215
- INNER JOIN dbo._InfoRg9937 T216
- ON ((T216._Fld9939_TYPE = 0x08 AND T216._Fld9939_RTRef = 0x00000095 AND T216._Fld9939_RRRef = ?) AND (T216._Fld9938_TYPE = T215._Fld784_TYPE AND T216._Fld9938_RTRef = T215._Fld784_RTRef AND T216._Fld9938_RRRef = T215._Fld784_RRRef))
- WHERE ((T215._Fld595 = ?)) AND (T216._Fld595 = ?)))
- WHERE ((T213._Fld595 = ?)) AND ((CASE WHEN T211._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T211._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T217
- WHERE ((T217._Fld595 = ?)) AND ((T217._Fld12072RRef = T213._IDRRef) AND (T217._Fld12073_TYPE = CASE WHEN T211._Fld12836RRef IS NOT NULL THEN 0x08 END AND T217._Fld12073_RTRef = CASE WHEN T211._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T217._Fld12073_RRRef = T211._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T218
- WHERE ((T218._Fld595 = ?)) AND ((T218._Fld12199RRef = T213._IDRRef) AND T218._Fld12200_TYPE = CASE WHEN T211._Fld12836RRef IS NOT NULL THEN 0x08 END AND T218._Fld12200_RTRef = CASE WHEN T211._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T218._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T210._Period >= ? AND T210._Period <= ? AND T210._Active = 0x01)
- GROUP BY T210._RecorderTRef,
- T210._RecorderRRef,
- T210._Fld10332_TYPE,
- T210._Fld10332_RTRef,
- T210._Fld10332_RRRef,
- T210._Fld10328RRef,
- T210._Fld10330RRef
- HAVING (CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN T210._Fld10334 ELSE 0.0 END) AS NUMERIC(27, 8))) <> 0.0 OR (CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN 0.0 ELSE T210._Fld10334 END) AS NUMERIC(27, 8))) <> 0.0 OR (CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN T210._Fld10335 ELSE 0.0 END) AS NUMERIC(27, 8))) <> 0.0 OR (CAST(SUM(CASE WHEN T210._RecordKind = 0.0 THEN 0.0 ELSE T210._Fld10335 END) AS NUMERIC(27, 8))) <> 0.0) T209
- LEFT OUTER JOIN (SELECT
- T220._IDRRef AS IDRRef,
- T220._Fld12836RRef AS Fld12836RRef,
- T220._Fld595 AS Fld595_,
- T220._Folder AS Folder_
- FROM dbo._Reference42 T220
- WHERE ((((T220._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T221
- INNER JOIN dbo._Reference21 T222
- ON (((T221._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T223
- WHERE ((T223._Fld595 = ?)) AND ((T223._Fld12065RRef = T221._IDRRef) AND (T223._Fld12066RRef = T222._IDRRef)))) AND T222._IDRRef IN
- (SELECT
- T224._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T224
- INNER JOIN dbo._InfoRg9937 T225
- ON ((T225._Fld9939_TYPE = 0x08 AND T225._Fld9939_RTRef = 0x00000095 AND T225._Fld9939_RRRef = ?) AND (T225._Fld9938_TYPE = T224._Fld784_TYPE AND T225._Fld9938_RTRef = T224._Fld784_RTRef AND T225._Fld9938_RRRef = T224._Fld784_RRRef))
- WHERE ((T224._Fld595 = ?)) AND (T225._Fld595 = ?)))
- WHERE ((T222._Fld595 = ?)) AND ((CASE WHEN T220._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T220._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T226
- WHERE ((T226._Fld595 = ?)) AND ((T226._Fld12072RRef = T222._IDRRef) AND (T226._Fld12073_TYPE = CASE WHEN T220._Fld12836RRef IS NOT NULL THEN 0x08 END AND T226._Fld12073_RTRef = CASE WHEN T220._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T226._Fld12073_RRRef = T220._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T227
- WHERE ((T227._Fld595 = ?)) AND ((T227._Fld12199RRef = T222._IDRRef) AND T227._Fld12200_TYPE = CASE WHEN T220._Fld12836RRef IS NOT NULL THEN 0x08 END AND T227._Fld12200_RTRef = CASE WHEN T220._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T227._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T220._Fld595 = ?)) T219
- ON T209.Fld10330RRef = T219.IDRRef
- WHERE (T209.RecorderTRef = 0x000000D1)
Add Comment
Please, Sign In to add comment