Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (@P1 numeric(10),@P2 numeric(10),@P3 nvarchar(4000),@P4 numeric(10),@P5 varbinary(16),@P6 numeric(10),@P7 numeric(10),@P8 numeric(10),@P9 numeric(10),@P10 numeric(10),@P11 datetime2(3),@P12 numeric(10),@P13 numeric(10),@P14 numeric(10),@P15 numeric(10),@P16 nvarchar(4000),@P17 numeric(10),@P18 varbinary(16),@P19 numeric(10),@P20 numeric(10),@P21 numeric(10),@P22 numeric(10),@P23 numeric(10),@P24 datetime2(3),@P25 datetime2(3),@P26 nvarchar(4000),@P27 numeric(10),@P28 varbinary(16),@P29 numeric(10),@P30 numeric(10),@P31 numeric(10),@P32 numeric(10),@P33 numeric(10),@P34 numeric(10),@P35 numeric(10),@P36 numeric(10),@P37 nvarchar(4000),@P38 numeric(10),@P39 varbinary(16),@P40 numeric(10),@P41 numeric(10),@P42 numeric(10),@P43 numeric(10),@P44 numeric(10),@P45 numeric(10),@P46 numeric(10),@P47 numeric(10),@P48 nvarchar(4000),@P49 numeric(10),@P50 varbinary(16),@P51 numeric(10),@P52 numeric(10),@P53 numeric(10),@P54 numeric(10),@P55 numeric(10),@P56 numeric(10),@P57 numeric(10),@P58 numeric(10),@P59 numeric(10),@P60 numeric(10),@P61 numeric(10),@P62 nvarchar(4000),@P63 numeric(10),@P64 varbinary(16),@P65 numeric(10),@P66 numeric(10),@P67 numeric(10),@P68 numeric(10),@P69 numeric(10),@P70 numeric(10),@P71 numeric(10),@P72 nvarchar(4000),@P73 numeric(10),@P74 varbinary(16),@P75 numeric(10),@P76 numeric(10),@P77 numeric(10),@P78 numeric(10),@P79 numeric(10),@P80 numeric(10),@P81 numeric(10),@P82 nvarchar(4000),@P83 numeric(10),@P84 varbinary(16),@P85 numeric(10),@P86 numeric(10),@P87 numeric(10),@P88 numeric(10),@P89 numeric(10),@P90 numeric(10),@P91 numeric(10),@P92 nvarchar(4000),@P93 numeric(10),@P94 varbinary(16),@P95 numeric(10),@P96 numeric(10),@P97 numeric(10),@P98 numeric(10),@P99 numeric(10),@P100 numeric(10),@P101 numeric(10),@P102 numeric(10),@P103 nvarchar(4000),@P104 numeric(10),@P105 varbinary(16),@P106 numeric(10),@P107 numeric(10),@P108 numeric(10),@P109 numeric(10),@P110 numeric(10),@P111 numeric(10),@P112 numeric(10),@P113 varbinary(16),@P114 numeric(10),@P115 numeric(10),@P116 nvarchar(4000),@P117 numeric(10),@P118 varbinary(16),@P119 numeric(10),@P120 numeric(10),@P121 numeric(10),@P122 numeric(10),@P123 numeric(10),@P124 datetime2(3),@P125 numeric(10),@P126 numeric(10),@P127 numeric(10),@P128 numeric(10),@P129 nvarchar(4000),@P130 numeric(10),@P131 varbinary(16),@P132 numeric(10),@P133 numeric(10),@P134 numeric(10),@P135 numeric(10),@P136 numeric(10),@P137 datetime2(3),@P138 datetime2(3),@P139 nvarchar(4000),@P140 numeric(10),@P141 varbinary(16),@P142 numeric(10),@P143 numeric(10),@P144 numeric(10),@P145 numeric(10),@P146 numeric(10),@P147 numeric(10),@P148 numeric(10),@P149 numeric(10),@P150 nvarchar(4000),@P151 numeric(10),@P152 varbinary(16),@P153 numeric(10),@P154 numeric(10),@P155 numeric(10),@P156 numeric(10),@P157 numeric(10),@P158 numeric(10),@P159 numeric(10),@P160 numeric(10),@P161 nvarchar(4000),@P162 numeric(10),@P163 varbinary(16),@P164 numeric(10),@P165 numeric(10),@P166 numeric(10),@P167 numeric(10),@P168 numeric(10),@P169 numeric(10),@P170 numeric(10),@P171 numeric(10),@P172 numeric(10),@P173 numeric(10),@P174 numeric(10),@P175 nvarchar(4000),@P176 numeric(10),@P177 varbinary(16),@P178 numeric(10),@P179 numeric(10),@P180 numeric(10),@P181 numeric(10),@P182 numeric(10),@P183 numeric(10),@P184 numeric(10),@P185 nvarchar(4000),@P186 numeric(10),@P187 varbinary(16),@P188 numeric(10),@P189 numeric(10),@P190 numeric(10),@P191 numeric(10),@P192 numeric(10),@P193 numeric(10),@P194 numeric(10),@P195 nvarchar(4000),@P196 numeric(10),@P197 varbinary(16),@P198 numeric(10),@P199 numeric(10),@P200 numeric(10),@P201 numeric(10),@P202 numeric(10),@P203 numeric(10),@P204 numeric(10),@P205 nvarchar(4000),@P206 numeric(10),@P207 varbinary(16),@P208 numeric(10),@P209 numeric(10),@P210 numeric(10),@P211 numeric(10),@P212 numeric(10),@P213 numeric(10),@P214 numeric(10),@P215 numeric(10),@P216 nvarchar(4000),@P217 numeric(10),@P218 varbinary(16),@P219 numeric(10),@P220 numeric(10),@P221 numeric(10),@P222 numeric(10),@P223 numeric(10),@P224 numeric(10),@P225 numeric(10),@P226 varbinary(16))INSERT INTO #tt213 WITH(TABLOCK) (_Q_001_F_000RRef, _Q_001_F_001_TYPE, _Q_001_F_001_RTRef, _Q_001_F_001_RRRef, _Q_001_F_002, _Q_001_F_003, _Q_001_F_004RRef, _Q_001_F_005, _Q_001_F_006) SELECT
- T43.IDRRef,
- T23.Fld10540_TYPE,
- T23.Fld10540_RTRef,
- T23.Fld10540_RRRef,
- CASE WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E4 THEN T52._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E9 THEN T53.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D4 THEN T63._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000EA THEN T64.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FD THEN T76._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000107 THEN T77._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000103 THEN T78.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D8 THEN T88.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D7 THEN T98.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D3 THEN T108.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000F8 THEN T118._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FF THEN T119.Date_Time_ ELSE CAST(NULL AS DATETIME) END,
- CASE WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E4 THEN T52._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E9 THEN T53.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D4 THEN T63._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000EA THEN T64.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FD THEN T76._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000107 THEN T77._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000103 THEN T78.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D8 THEN T88.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D7 THEN T98.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D3 THEN T108.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000F8 THEN T118._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FF THEN T119.Number_ ELSE CAST(NULL AS NVARCHAR(15)) END,
- T129._Fld1083RRef,
- CAST(DATEDIFF(DAY,CASE WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E4 THEN T52._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E9 THEN T53.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D4 THEN T63._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000EA THEN T64.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FD THEN T76._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000107 THEN T77._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000103 THEN T78.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D8 THEN T88.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D7 THEN T98.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D3 THEN T108.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000F8 THEN T118._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FF THEN T119.Date_Time_ ELSE CAST(NULL AS DATETIME) END,{ts '4019-03-24 23:59:59'}) AS NUMERIC(12)),
- CAST(SUM(T23.Fld10545Balance_) AS NUMERIC(38, 8))
- FROM (SELECT
- T24.Fld10540_TYPE AS Fld10540_TYPE,
- T24.Fld10540_RTRef AS Fld10540_RTRef,
- T24.Fld10540_RRRef AS Fld10540_RRRef,
- T24.Fld10538RRef AS Fld10538RRef,
- T24.Fld10537RRef AS Fld10537RRef,
- T24.Fld10539RRef AS Fld10539RRef,
- CAST(SUM(T24.Fld10545Balance_) AS NUMERIC(38, 8)) AS Fld10545Balance_
- FROM (SELECT
- T25._Fld10540_TYPE AS Fld10540_TYPE,
- T25._Fld10540_RTRef AS Fld10540_RTRef,
- T25._Fld10540_RRRef AS Fld10540_RRRef,
- T25._Fld10538RRef AS Fld10538RRef,
- T25._Fld10537RRef AS Fld10537RRef,
- T25._Fld10539RRef AS Fld10539RRef,
- CAST(SUM(T25._Fld10545) AS NUMERIC(33, 8)) AS Fld10545Balance_
- FROM dbo._AccumRgT10549 T25
- WHERE (((T25._Fld595 = @P1)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T26
- ON ((T25._Fld10538RRef = T26._IDRRef)) AND (T26._Fld595 = @P2)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T27
- INNER JOIN dbo._Reference21 T28
- ON (((T27._Fld1685 = @P3) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T29
- WHERE ((T29._Fld595 = @P4)) AND ((T29._Fld12065RRef = T27._IDRRef) AND (T29._Fld12066RRef = T28._IDRRef)))) AND T28._IDRRef IN
- (SELECT
- T30._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T30
- INNER JOIN dbo._InfoRg9937 T31
- ON ((T31._Fld9939_TYPE = 0x08 AND T31._Fld9939_RTRef = 0x00000095 AND T31._Fld9939_RRRef = @P5) AND (T31._Fld9938_TYPE = T30._Fld784_TYPE AND T31._Fld9938_RTRef = T30._Fld784_RTRef AND T31._Fld9938_RRRef = T30._Fld784_RRRef))
- WHERE ((T30._Fld595 = @P6)) AND (T31._Fld595 = @P7)))
- WHERE ((T28._Fld595 = @P8)) AND ((CASE WHEN T26._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T26._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T32
- WHERE ((T32._Fld595 = @P9)) AND ((T32._Fld12072RRef = T28._IDRRef) AND (T32._Fld12073_TYPE = CASE WHEN T26._Fld12836RRef IS NOT NULL THEN 0x08 END AND T32._Fld12073_RTRef = CASE WHEN T26._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T32._Fld12073_RRRef = T26._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T33
- WHERE ((T33._Fld595 = @P10)) AND ((T33._Fld12199RRef = T28._IDRRef) AND T33._Fld12200_TYPE = CASE WHEN T26._Fld12836RRef IS NOT NULL THEN 0x08 END AND T33._Fld12200_RTRef = CASE WHEN T26._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T33._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T25._Period = @P11 AND (0x00) = 0x01 AND (T25._Fld10545 <> @P12) AND (T25._Fld10545 <> @P13))
- GROUP BY T25._Fld10540_TYPE,
- T25._Fld10540_RTRef,
- T25._Fld10540_RRRef,
- T25._Fld10538RRef,
- T25._Fld10537RRef,
- T25._Fld10539RRef
- HAVING (CAST(SUM(T25._Fld10545) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- T34._Fld10540_TYPE AS Fld10540_TYPE,
- T34._Fld10540_RTRef AS Fld10540_RTRef,
- T34._Fld10540_RRRef AS Fld10540_RRRef,
- T34._Fld10538RRef AS Fld10538RRef,
- T34._Fld10537RRef AS Fld10537RRef,
- T34._Fld10539RRef AS Fld10539RRef,
- CAST(CAST(SUM(CASE WHEN T34._RecordKind = 0.0 THEN -T34._Fld10545 ELSE T34._Fld10545 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld10545Balance_
- FROM dbo._AccumRg10535 T34
- WHERE (((T34._Fld595 = @P14)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T35
- ON ((T34._Fld10538RRef = T35._IDRRef)) AND (T35._Fld595 = @P15)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T36
- INNER JOIN dbo._Reference21 T37
- ON (((T36._Fld1685 = @P16) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T38
- WHERE ((T38._Fld595 = @P17)) AND ((T38._Fld12065RRef = T36._IDRRef) AND (T38._Fld12066RRef = T37._IDRRef)))) AND T37._IDRRef IN
- (SELECT
- T39._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T39
- INNER JOIN dbo._InfoRg9937 T40
- ON ((T40._Fld9939_TYPE = 0x08 AND T40._Fld9939_RTRef = 0x00000095 AND T40._Fld9939_RRRef = @P18) AND (T40._Fld9938_TYPE = T39._Fld784_TYPE AND T40._Fld9938_RTRef = T39._Fld784_RTRef AND T40._Fld9938_RRRef = T39._Fld784_RRRef))
- WHERE ((T39._Fld595 = @P19)) AND (T40._Fld595 = @P20)))
- WHERE ((T37._Fld595 = @P21)) AND ((CASE WHEN T35._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T35._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T41
- WHERE ((T41._Fld595 = @P22)) AND ((T41._Fld12072RRef = T37._IDRRef) AND (T41._Fld12073_TYPE = CASE WHEN T35._Fld12836RRef IS NOT NULL THEN 0x08 END AND T41._Fld12073_RTRef = CASE WHEN T35._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T41._Fld12073_RRRef = T35._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T42
- WHERE ((T42._Fld595 = @P23)) AND ((T42._Fld12199RRef = T37._IDRRef) AND T42._Fld12200_TYPE = CASE WHEN T35._Fld12836RRef IS NOT NULL THEN 0x08 END AND T42._Fld12200_RTRef = CASE WHEN T35._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T42._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T34._Period >= @P24 AND T34._Period < @P25 AND T34._Active = 0x01 AND (0x00) = 0x01)
- GROUP BY T34._Fld10540_TYPE,
- T34._Fld10540_RTRef,
- T34._Fld10540_RRRef,
- T34._Fld10538RRef,
- T34._Fld10537RRef,
- T34._Fld10539RRef
- HAVING (CAST(CAST(SUM(CASE WHEN T34._RecordKind = 0.0 THEN -T34._Fld10545 ELSE T34._Fld10545 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T24
- GROUP BY T24.Fld10540_TYPE,
- T24.Fld10540_RTRef,
- T24.Fld10540_RRRef,
- T24.Fld10538RRef,
- T24.Fld10537RRef,
- T24.Fld10539RRef
- HAVING (CAST(SUM(T24.Fld10545Balance_) AS NUMERIC(38, 8))) <> 0.0) T23
- LEFT OUTER JOIN (SELECT
- T44._IDRRef AS IDRRef,
- T44._Folder AS Folder_,
- T44._Fld12836RRef AS Fld12836RRef,
- T44._Fld595 AS Fld595_
- FROM dbo._Reference42 T44
- WHERE ((((T44._Folder = 0x00) OR EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T45
- INNER JOIN dbo._Reference21 T46
- ON (((T45._Fld1685 = @P26) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T47
- WHERE ((T47._Fld595 = @P27)) AND ((T47._Fld12065RRef = T45._IDRRef) AND (T47._Fld12066RRef = T46._IDRRef)))) AND T46._IDRRef IN
- (SELECT
- T48._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T48
- INNER JOIN dbo._InfoRg9937 T49
- ON ((T49._Fld9939_TYPE = 0x08 AND T49._Fld9939_RTRef = 0x00000095 AND T49._Fld9939_RRRef = @P28) AND (T49._Fld9938_TYPE = T48._Fld784_TYPE AND T49._Fld9938_RTRef = T48._Fld784_RTRef AND T49._Fld9938_RRRef = T48._Fld784_RRRef))
- WHERE ((T48._Fld595 = @P29)) AND (T49._Fld595 = @P30)))
- WHERE ((T46._Fld595 = @P31)) AND ((CASE WHEN T44._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T50
- WHERE ((T50._Fld595 = @P32)) AND ((T50._Fld12072RRef = T46._IDRRef) AND (T50._Fld12073_TYPE = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END AND T50._Fld12073_RTRef = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T50._Fld12073_RRRef = T44._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T51
- WHERE ((T51._Fld595 = @P33)) AND ((T51._Fld12199RRef = T46._IDRRef) AND T51._Fld12200_TYPE = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x08 END AND T51._Fld12200_RTRef = CASE WHEN T44._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T51._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T44._Fld595 = @P34)) T43
- ON (T23.Fld10538RRef = T43.IDRRef)
- LEFT OUTER JOIN dbo._Document228 T52
- ON (T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E4 AND T23.Fld10540_RRRef = T52._IDRRef) AND (T52._Fld595 = @P35)
- LEFT OUTER JOIN (SELECT
- T54._Number COLLATE Latin1_General_CI_AS AS Number_,
- T54._Date_Time AS Date_Time_,
- T54._IDRRef AS IDRRef,
- T54._Fld4625RRef AS Fld4625RRef,
- T54._Fld595 AS Fld595_
- FROM dbo._Document233 T54
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T55
- ON ((T54._Fld4625RRef = T55._IDRRef)) AND (T55._Fld595 = @P36)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T56
- INNER JOIN dbo._Reference21 T57
- ON (((T56._Fld1685 = @P37) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T58
- WHERE ((T58._Fld595 = @P38)) 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 = @P39) AND (T60._Fld9938_TYPE = T59._Fld784_TYPE AND T60._Fld9938_RTRef = T59._Fld784_RTRef AND T60._Fld9938_RRRef = T59._Fld784_RRRef))
- WHERE ((T59._Fld595 = @P40)) AND (T60._Fld595 = @P41)))
- WHERE ((T57._Fld595 = @P42)) 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 = @P43)) 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 = @P44)) 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 = @P45)) T53
- ON T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E9 AND T23.Fld10540_RRRef = T53.IDRRef
- LEFT OUTER JOIN dbo._Document212 T63
- ON (T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D4 AND T23.Fld10540_RRRef = T63._IDRRef) AND (T63._Fld595 = @P46)
- LEFT OUTER JOIN (SELECT
- T65._IDRRef AS IDRRef,
- T65._Fld595 AS Fld595_,
- T65._Fld4774RRef AS Fld4774RRef,
- T65._Date_Time AS Date_Time_,
- T65._Number COLLATE Latin1_General_CI_AS AS Number_,
- T65._Fld4779RRef AS Fld4779RRef
- FROM dbo._Document234 T65
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T66
- ON ((T65._Fld4774RRef = T66._IDRRef)) AND (T66._Fld595 = @P47)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T67
- INNER JOIN dbo._Reference21 T68
- ON (((T67._Fld1685 = @P48) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T69
- WHERE ((T69._Fld595 = @P49)) AND ((T69._Fld12065RRef = T67._IDRRef) AND (T69._Fld12066RRef = T68._IDRRef)))) AND T68._IDRRef IN
- (SELECT
- T70._Reference21_IDRRef AS Q_007_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 = @P50) AND (T71._Fld9938_TYPE = T70._Fld784_TYPE AND T71._Fld9938_RTRef = T70._Fld784_RTRef AND T71._Fld9938_RRRef = T70._Fld784_RRRef))
- WHERE ((T70._Fld595 = @P51)) AND (T71._Fld595 = @P52)))
- WHERE ((T68._Fld595 = @P53)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T72
- WHERE ((T72._Fld595 = @P54)) AND ((T72._Fld12072RRef = T68._IDRRef) AND (T72._Fld12073_TYPE = 0x08 AND T72._Fld12073_RTRef = 0x0000001C AND T72._Fld12073_RRRef = T65._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T73
- WHERE ((T73._Fld595 = @P55)) AND ((T73._Fld12199RRef = T68._IDRRef) AND T73._Fld12200_TYPE = 0x08 AND T73._Fld12200_RTRef = 0x0000001C AND (T73._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) 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_004_F_000_
- FROM dbo._InfoRg11710 T74
- WHERE ((T74._Fld595 = @P56)) AND ((T74._Fld12072RRef = T68._IDRRef) AND (T74._Fld12073_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T74._Fld12073_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T74._Fld12073_RRRef = T66._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T75
- WHERE ((T75._Fld595 = @P57)) AND ((T75._Fld12199RRef = T68._IDRRef) AND T75._Fld12200_TYPE = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x08 END AND T75._Fld12200_RTRef = CASE WHEN T66._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T75._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T65._Fld595 = @P58)) T64
- ON T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000EA AND T23.Fld10540_RRRef = T64.IDRRef
- LEFT OUTER JOIN dbo._Document253 T76
- ON (T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FD AND T23.Fld10540_RRRef = T76._IDRRef) AND (T76._Fld595 = @P59)
- LEFT OUTER JOIN dbo._Document263 T77
- ON (T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000107 AND T23.Fld10540_RRRef = T77._IDRRef) AND (T77._Fld595 = @P60)
- LEFT OUTER JOIN (SELECT
- T79._Fld6139RRef AS Fld6139RRef,
- T79._Fld595 AS Fld595_,
- T79._Number COLLATE Latin1_General_CI_AS AS Number_,
- T79._IDRRef AS IDRRef,
- T79._Date_Time AS Date_Time_
- FROM dbo._Document259 T79
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T80
- ON ((T79._Fld6139RRef = T80._IDRRef)) AND (T80._Fld595 = @P61)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T81
- INNER JOIN dbo._Reference21 T82
- ON (((T81._Fld1685 = @P62) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T83
- WHERE ((T83._Fld595 = @P63)) AND ((T83._Fld12065RRef = T81._IDRRef) AND (T83._Fld12066RRef = T82._IDRRef)))) AND T82._IDRRef IN
- (SELECT
- T84._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T84
- INNER JOIN dbo._InfoRg9937 T85
- ON ((T85._Fld9939_TYPE = 0x08 AND T85._Fld9939_RTRef = 0x00000095 AND T85._Fld9939_RRRef = @P64) AND (T85._Fld9938_TYPE = T84._Fld784_TYPE AND T85._Fld9938_RTRef = T84._Fld784_RTRef AND T85._Fld9938_RRRef = T84._Fld784_RRRef))
- WHERE ((T84._Fld595 = @P65)) AND (T85._Fld595 = @P66)))
- WHERE ((T82._Fld595 = @P67)) AND ((CASE WHEN T80._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T86
- WHERE ((T86._Fld595 = @P68)) AND ((T86._Fld12072RRef = T82._IDRRef) AND (T86._Fld12073_TYPE = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END AND T86._Fld12073_RTRef = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T86._Fld12073_RRRef = T80._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T87
- WHERE ((T87._Fld595 = @P69)) AND ((T87._Fld12199RRef = T82._IDRRef) AND T87._Fld12200_TYPE = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END AND T87._Fld12200_RTRef = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T87._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T79._Fld595 = @P70)) T78
- ON T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000103 AND T23.Fld10540_RRRef = T78.IDRRef
- LEFT OUTER JOIN (SELECT
- T89._Fld3845RRef AS Fld3845RRef,
- T89._IDRRef AS IDRRef,
- T89._Date_Time AS Date_Time_,
- T89._Number COLLATE Latin1_General_CI_AS AS Number_,
- T89._Fld595 AS Fld595_
- FROM dbo._Document216 T89
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T90
- ON ((T89._Fld3845RRef = T90._IDRRef)) AND (T90._Fld595 = @P71)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T91
- INNER JOIN dbo._Reference21 T92
- ON (((T91._Fld1685 = @P72) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T93
- WHERE ((T93._Fld595 = @P73)) AND ((T93._Fld12065RRef = T91._IDRRef) AND (T93._Fld12066RRef = T92._IDRRef)))) AND T92._IDRRef IN
- (SELECT
- T94._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T94
- INNER JOIN dbo._InfoRg9937 T95
- ON ((T95._Fld9939_TYPE = 0x08 AND T95._Fld9939_RTRef = 0x00000095 AND T95._Fld9939_RRRef = @P74) AND (T95._Fld9938_TYPE = T94._Fld784_TYPE AND T95._Fld9938_RTRef = T94._Fld784_RTRef AND T95._Fld9938_RRRef = T94._Fld784_RRRef))
- WHERE ((T94._Fld595 = @P75)) AND (T95._Fld595 = @P76)))
- WHERE ((T92._Fld595 = @P77)) AND ((CASE WHEN T90._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T90._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T96
- WHERE ((T96._Fld595 = @P78)) AND ((T96._Fld12072RRef = T92._IDRRef) AND (T96._Fld12073_TYPE = CASE WHEN T90._Fld12836RRef IS NOT NULL THEN 0x08 END AND T96._Fld12073_RTRef = CASE WHEN T90._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T96._Fld12073_RRRef = T90._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T97
- WHERE ((T97._Fld595 = @P79)) AND ((T97._Fld12199RRef = T92._IDRRef) AND T97._Fld12200_TYPE = CASE WHEN T90._Fld12836RRef IS NOT NULL THEN 0x08 END AND T97._Fld12200_RTRef = CASE WHEN T90._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T97._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T89._Fld595 = @P80)) T88
- ON T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D8 AND T23.Fld10540_RRRef = T88.IDRRef
- LEFT OUTER JOIN (SELECT
- T99._IDRRef AS IDRRef,
- T99._Fld595 AS Fld595_,
- T99._Fld3734RRef AS Fld3734RRef,
- T99._Date_Time AS Date_Time_,
- T99._Number COLLATE Latin1_General_CI_AS AS Number_
- FROM dbo._Document215 T99
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T100
- ON ((T99._Fld3734RRef = T100._IDRRef)) AND (T100._Fld595 = @P81)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T101
- INNER JOIN dbo._Reference21 T102
- ON (((T101._Fld1685 = @P82) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T103
- WHERE ((T103._Fld595 = @P83)) AND ((T103._Fld12065RRef = T101._IDRRef) AND (T103._Fld12066RRef = T102._IDRRef)))) AND T102._IDRRef IN
- (SELECT
- T104._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T104
- INNER JOIN dbo._InfoRg9937 T105
- ON ((T105._Fld9939_TYPE = 0x08 AND T105._Fld9939_RTRef = 0x00000095 AND T105._Fld9939_RRRef = @P84) AND (T105._Fld9938_TYPE = T104._Fld784_TYPE AND T105._Fld9938_RTRef = T104._Fld784_RTRef AND T105._Fld9938_RRRef = T104._Fld784_RRRef))
- WHERE ((T104._Fld595 = @P85)) AND (T105._Fld595 = @P86)))
- WHERE ((T102._Fld595 = @P87)) AND ((CASE WHEN T100._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T100._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T106
- WHERE ((T106._Fld595 = @P88)) AND ((T106._Fld12072RRef = T102._IDRRef) AND (T106._Fld12073_TYPE = CASE WHEN T100._Fld12836RRef IS NOT NULL THEN 0x08 END AND T106._Fld12073_RTRef = CASE WHEN T100._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T106._Fld12073_RRRef = T100._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T107
- WHERE ((T107._Fld595 = @P89)) AND ((T107._Fld12199RRef = T102._IDRRef) AND T107._Fld12200_TYPE = CASE WHEN T100._Fld12836RRef IS NOT NULL THEN 0x08 END AND T107._Fld12200_RTRef = CASE WHEN T100._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T107._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T99._Fld595 = @P90)) T98
- ON T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D7 AND T23.Fld10540_RRRef = T98.IDRRef
- LEFT OUTER JOIN (SELECT
- T109._Fld3438RRef AS Fld3438RRef,
- T109._IDRRef AS IDRRef,
- T109._Number COLLATE Latin1_General_CI_AS AS Number_,
- T109._Fld595 AS Fld595_,
- T109._Date_Time AS Date_Time_
- FROM dbo._Document211 T109
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T110
- ON ((T109._Fld3438RRef = T110._IDRRef)) AND (T110._Fld595 = @P91)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T111
- INNER JOIN dbo._Reference21 T112
- ON (((T111._Fld1685 = @P92) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T113
- WHERE ((T113._Fld595 = @P93)) AND ((T113._Fld12065RRef = T111._IDRRef) AND (T113._Fld12066RRef = T112._IDRRef)))) AND T112._IDRRef IN
- (SELECT
- T114._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T114
- INNER JOIN dbo._InfoRg9937 T115
- ON ((T115._Fld9939_TYPE = 0x08 AND T115._Fld9939_RTRef = 0x00000095 AND T115._Fld9939_RRRef = @P94) AND (T115._Fld9938_TYPE = T114._Fld784_TYPE AND T115._Fld9938_RTRef = T114._Fld784_RTRef AND T115._Fld9938_RRRef = T114._Fld784_RRRef))
- WHERE ((T114._Fld595 = @P95)) AND (T115._Fld595 = @P96)))
- WHERE ((T112._Fld595 = @P97)) AND ((CASE WHEN T110._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T110._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T116
- WHERE ((T116._Fld595 = @P98)) AND ((T116._Fld12072RRef = T112._IDRRef) AND (T116._Fld12073_TYPE = CASE WHEN T110._Fld12836RRef IS NOT NULL THEN 0x08 END AND T116._Fld12073_RTRef = CASE WHEN T110._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T116._Fld12073_RRRef = T110._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T117
- WHERE ((T117._Fld595 = @P99)) AND ((T117._Fld12199RRef = T112._IDRRef) AND T117._Fld12200_TYPE = CASE WHEN T110._Fld12836RRef IS NOT NULL THEN 0x08 END AND T117._Fld12200_RTRef = CASE WHEN T110._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T117._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T109._Fld595 = @P100)) T108
- ON T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D3 AND T23.Fld10540_RRRef = T108.IDRRef
- LEFT OUTER JOIN dbo._Document248 T118
- ON (T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000F8 AND T23.Fld10540_RRRef = T118._IDRRef) AND (T118._Fld595 = @P101)
- LEFT OUTER JOIN (SELECT
- T120._Number COLLATE Latin1_General_CI_AS AS Number_,
- T120._Date_Time AS Date_Time_,
- T120._Fld5855RRef AS Fld5855RRef,
- T120._IDRRef AS IDRRef,
- T120._Fld595 AS Fld595_
- FROM dbo._Document255 T120
- WHERE ((EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T121
- ON ((T120._Fld5855RRef = T121._IDRRef)) AND (T121._Fld595 = @P102)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T122
- INNER JOIN dbo._Reference21 T123
- ON (((T122._Fld1685 = @P103) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T124
- WHERE ((T124._Fld595 = @P104)) AND ((T124._Fld12065RRef = T122._IDRRef) AND (T124._Fld12066RRef = T123._IDRRef)))) AND T123._IDRRef IN
- (SELECT
- T125._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T125
- INNER JOIN dbo._InfoRg9937 T126
- ON ((T126._Fld9939_TYPE = 0x08 AND T126._Fld9939_RTRef = 0x00000095 AND T126._Fld9939_RRRef = @P105) AND (T126._Fld9938_TYPE = T125._Fld784_TYPE AND T126._Fld9938_RTRef = T125._Fld784_RTRef AND T126._Fld9938_RRRef = T125._Fld784_RRRef))
- WHERE ((T125._Fld595 = @P106)) AND (T126._Fld595 = @P107)))
- WHERE ((T123._Fld595 = @P108)) AND ((CASE WHEN T121._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T127
- WHERE ((T127._Fld595 = @P109)) AND ((T127._Fld12072RRef = T123._IDRRef) AND (T127._Fld12073_TYPE = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x08 END AND T127._Fld12073_RTRef = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T127._Fld12073_RRRef = T121._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T128
- WHERE ((T128._Fld595 = @P110)) AND ((T128._Fld12199RRef = T123._IDRRef) AND T128._Fld12200_TYPE = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x08 END AND T128._Fld12200_RTRef = CASE WHEN T121._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T128._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T120._Fld595 = @P111)) T119
- ON T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FF AND T23.Fld10540_RRRef = T119.IDRRef
- LEFT OUTER JOIN dbo._Reference43 T129
- ON (T23.Fld10539RRef = T129._IDRRef) AND (T129._Fld595 = @P112)
- WHERE (T23.Fld10540_TYPE <> 0x01) AND (T23.Fld10537RRef = @P113)
- GROUP BY T23.Fld10540_TYPE,
- T23.Fld10540_RTRef,
- T23.Fld10540_RRRef,
- CASE WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E4 THEN T52._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E9 THEN T53.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D4 THEN T63._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000EA THEN T64.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FD THEN T76._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000107 THEN T77._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000103 THEN T78.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D8 THEN T88.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D7 THEN T98.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D3 THEN T108.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000F8 THEN T118._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FF THEN T119.Date_Time_ ELSE CAST(NULL AS DATETIME) END,
- CASE WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E4 THEN T52._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E9 THEN T53.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D4 THEN T63._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000EA THEN T64.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FD THEN T76._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000107 THEN T77._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000103 THEN T78.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D8 THEN T88.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D7 THEN T98.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D3 THEN T108.Number_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000F8 THEN T118._Number WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FF THEN T119.Number_ ELSE CAST(NULL AS NVARCHAR(15)) END,
- T129._Fld1083RRef,
- CAST(DATEDIFF(DAY,CASE WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E4 THEN T52._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000E9 THEN T53.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D4 THEN T63._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000EA THEN T64.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FD THEN T76._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000107 THEN T77._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x00000103 THEN T78.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D8 THEN T88.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D7 THEN T98.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000D3 THEN T108.Date_Time_ WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000F8 THEN T118._Date_Time WHEN T23.Fld10540_TYPE = 0x08 AND T23.Fld10540_RTRef = 0x000000FF THEN T119.Date_Time_ ELSE CAST(NULL AS DATETIME) END,{ts '4019-03-24 23:59:59'}) AS NUMERIC(12)),
- T43.IDRRef
- UNION ALL SELECT
- T150.IDRRef,
- T130.Fld10332_TYPE,
- T130.Fld10332_RTRef,
- T130.Fld10332_RRRef,
- CASE WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000E4 THEN T159._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000E9 THEN T160.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D4 THEN T170._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000EA THEN T171.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000FD THEN T183._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x00000107 THEN T184._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x00000103 THEN T185.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D8 THEN T195.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D7 THEN T205.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D3 THEN T215.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000F8 THEN T225._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000FF THEN T226.Date_Time_ ELSE CAST(NULL AS DATETIME) END,
- CASE WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000E4 THEN T159._Number WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000E9 THEN T160.Number_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D4 THEN T170._Number WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000EA THEN T171.Number_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000FD THEN T183._Number WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x00000107 THEN T184._Number WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x00000103 THEN T185.Number_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D8 THEN T195.Number_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D7 THEN T205.Number_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D3 THEN T215.Number_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000F8 THEN T225._Number WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000FF THEN T226.Number_ ELSE CAST(NULL AS NVARCHAR(15)) END,
- T236._Fld1083RRef,
- CAST(DATEDIFF(DAY,CASE WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000E4 THEN T159._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000E9 THEN T160.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D4 THEN T170._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000EA THEN T171.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000FD THEN T183._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x00000107 THEN T184._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x00000103 THEN T185.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D8 THEN T195.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D7 THEN T205.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000D3 THEN T215.Date_Time_ WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000F8 THEN T225._Date_Time WHEN T130.Fld10332_TYPE = 0x08 AND T130.Fld10332_RTRef = 0x000000FF THEN T226.Date_Time_ ELSE CAST(NULL AS DATETIME) END,{ts '4019-03-24 23:59:59'}) AS NUMERIC(12)),
- CAST(SUM(T130.Fld10335Balance_) AS NUMERIC(38, 8))
- FROM (SELECT
- T131.Fld10332_TYPE AS Fld10332_TYPE,
- T131.Fld10332_RTRef AS Fld10332_RTRef,
- T131.Fld10332_RRRef AS Fld10332_RRRef,
- T131.Fld10329RRef AS Fld10329RRef,
- T131.Fld10331RRef AS Fld10331RRef,
- T131.Fld10330RRef AS Fld10330RRef,
- CAST(SUM(T131.Fld10335Balance_) AS NUMERIC(38, 8)) AS Fld10335Balance_
- FROM (SELECT
- T132._Fld10332_TYPE AS Fld10332_TYPE,
- T132._Fld10332_RTRef AS Fld10332_RTRef,
- T132._Fld10332_RRRef AS Fld10332_RRRef,
- T132._Fld10329RRef AS Fld10329RRef,
- T132._Fld10331RRef AS Fld10331RRef,
- T132._Fld10330RRef AS Fld10330RRef,
- CAST(SUM(T132._Fld10335) AS NUMERIC(33, 8)) AS Fld10335Balance_
- FROM dbo._AccumRgT10337 T132
- WHERE (((T132._Fld595 = @P114)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T133
- ON ((T132._Fld10330RRef = T133._IDRRef)) AND (T133._Fld595 = @P115)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T134
- INNER JOIN dbo._Reference21 T135
- ON (((T134._Fld1685 = @P116) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T136
- WHERE ((T136._Fld595 = @P117)) 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 = @P118) AND (T138._Fld9938_TYPE = T137._Fld784_TYPE AND T138._Fld9938_RTRef = T137._Fld784_RTRef AND T138._Fld9938_RRRef = T137._Fld784_RRRef))
- WHERE ((T137._Fld595 = @P119)) AND (T138._Fld595 = @P120)))
- WHERE ((T135._Fld595 = @P121)) 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 = @P122)) 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 = @P123)) 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._Period = @P124 AND (0x00) = 0x01 AND (T132._Fld10335 <> @P125) AND (T132._Fld10335 <> @P126))
- GROUP BY T132._Fld10332_TYPE,
- T132._Fld10332_RTRef,
- T132._Fld10332_RRRef,
- T132._Fld10329RRef,
- T132._Fld10331RRef,
- T132._Fld10330RRef
- HAVING (CAST(SUM(T132._Fld10335) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- T141._Fld10332_TYPE AS Fld10332_TYPE,
- T141._Fld10332_RTRef AS Fld10332_RTRef,
- T141._Fld10332_RRRef AS Fld10332_RRRef,
- T141._Fld10329RRef AS Fld10329RRef,
- T141._Fld10331RRef AS Fld10331RRef,
- T141._Fld10330RRef AS Fld10330RRef,
- CAST(CAST(SUM(CASE WHEN T141._RecordKind = 0.0 THEN -T141._Fld10335 ELSE T141._Fld10335 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld10335Balance_
- FROM dbo._AccumRg10327 T141
- WHERE (((T141._Fld595 = @P127)) AND (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T142
- ON ((T141._Fld10330RRef = T142._IDRRef)) AND (T142._Fld595 = @P128)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T143
- INNER JOIN dbo._Reference21 T144
- ON (((T143._Fld1685 = @P129) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T145
- WHERE ((T145._Fld595 = @P130)) AND ((T145._Fld12065RRef = T143._IDRRef) AND (T145._Fld12066RRef = T144._IDRRef)))) AND T144._IDRRef IN
- (SELECT
- T146._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T146
- INNER JOIN dbo._InfoRg9937 T147
- ON ((T147._Fld9939_TYPE = 0x08 AND T147._Fld9939_RTRef = 0x00000095 AND T147._Fld9939_RRRef = @P131) AND (T147._Fld9938_TYPE = T146._Fld784_TYPE AND T147._Fld9938_RTRef = T146._Fld784_RTRef AND T147._Fld9938_RRRef = T146._Fld784_RRRef))
- WHERE ((T146._Fld595 = @P132)) AND (T147._Fld595 = @P133)))
- WHERE ((T144._Fld595 = @P134)) AND ((CASE WHEN T142._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T142._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T148
- WHERE ((T148._Fld595 = @P135)) AND ((T148._Fld12072RRef = T144._IDRRef) AND (T148._Fld12073_TYPE = CASE WHEN T142._Fld12836RRef IS NOT NULL THEN 0x08 END AND T148._Fld12073_RTRef = CASE WHEN T142._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T148._Fld12073_RRRef = T142._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T149
- WHERE ((T149._Fld595 = @P136)) AND ((T149._Fld12199RRef = T144._IDRRef) AND T149._Fld12200_TYPE = CASE WHEN T142._Fld12836RRef IS NOT NULL THEN 0x08 END AND T149._Fld12200_RTRef = CASE WHEN T142._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T149._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T141._Period >= @P137 AND T141._Period < @P138 AND T141._Active = 0x01 AND (0x00) = 0x01)
- GROUP BY T141._Fld10332
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement