Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 50.299=TotalDurationSec,1.572=AvgDurationSec,32=Execs,,4,Sql="INSERT INTO #tt WITH(TABLOCK) (_Q_001_F_000RRef, _Q_001_F_001, _Q_001_F_002RRef, _Q_001_F_003, _Q_001_F_004RRef) SELECT
- T1._Q_001_F_001RRef,
- T1._Q_001_F_002,
- T1._Q_001_F_003RRef,
- CASE WHEN (1=1) AND CASE WHEN 1=1 THEN CASE WHEN 1=1 THEN 0 ELSE 2000000000 END + 2000000000 ELSE 0 END = 2000000000 THEN CAST(SUM(ISNULL(CAST(CASE WHEN (T1._Q_001_F_000RRef = 0x00000000000000000000000000000000) THEN CAST(((CAST((CAST(T2._Q_001_F_000 AS NUMERIC(26, 2)) * CAST(T4._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T1._Q_001_F_005 AS NUMERIC(8, 0))) / (T1._Q_001_F_004 * ISNULL(CAST(T4._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) ELSE T2._Q_001_F_000 END AS NUMERIC(33, 2)),0.0)) AS NUMERIC(38, 8)) END,
- T1._Q_001_F_000RRef
- FROM #tt T1 WITH(NOLOCK)
- LEFT OUTER JOIN #tt T2 WITH(NOLOCK)
- LEFT OUTER JOIN dbo._Reference43 T3
- ON (T2._Q_001_F_001RRef = T3._IDRRef) AND (T3._Fld595 = ?)
- LEFT OUTER JOIN #tt T4 WITH(NOLOCK)
- ON (T3._Fld1083RRef = T4._Q_000_F_000RRef)
- ON CASE WHEN (T1._Q_001_F_000RRef = ?) THEN 0x01 ELSE CASE WHEN (T1._Q_001_F_000RRef = T2._Q_001_F_001RRef) THEN 0x01 WHEN NOT (T1._Q_001_F_000RRef = T2._Q_001_F_001RRef) THEN 0x00 END END = 0x01
- WHERE (T1._Q_001_F_001RRef = ?)
- GROUP BY T1._Q_001_F_001RRef,
- T1._Q_001_F_002,
- T1._Q_001_F_000RRef,
- T1._Q_001_F_003RRef
- UNION ALL SELECT
- T5._Q_001_F_001RRef,
- T5._Q_001_F_002,
- T5._Q_001_F_003RRef,
- CAST(SUM(ISNULL(CAST(CASE WHEN (T5._Q_001_F_000RRef = 0x00000000000000000000000000000000) THEN CAST(((CAST((CAST(T6.Fld11503Balance_ AS NUMERIC(26, 2)) * CAST(T29._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T5._Q_001_F_005 AS NUMERIC(8, 0))) / (T5._Q_001_F_004 * ISNULL(CAST(T29._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) ELSE T6.Fld11503Balance_ END AS NUMERIC(33, 2)),0.0)) AS NUMERIC(38, 8)),
- T5._Q_001_F_000RRef
- FROM #tt T5 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- MIN(ISNULL(T7.SDBL_RLS_SIGNAL_,0x01)) AS SDBL_RLS_SIGNAL_,
- T7.Fld11497RRef AS Fld11497RRef,
- CAST(SUM(T7.Fld11503Balance_) AS NUMERIC(38, 8)) AS Fld11503Balance_
- FROM (SELECT
- MIN(T8.SDBL_RLS_SIGNAL_) AS SDBL_RLS_SIGNAL_,
- T8.Fld11497RRef AS Fld11497RRef,
- CAST(SUM(T8.Fld11503_) AS NUMERIC(33, 8)) AS Fld11503Balance_
- FROM (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T10
- ON ((T9._Fld11496RRef = T10._IDRRef)) AND (T10._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T11
- INNER JOIN dbo._Reference21 T12
- ON (((T11._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T13
- WHERE ((T13._Fld595 = ?)) AND ((T13._Fld12065RRef = T11._IDRRef) AND (T13._Fld12066RRef = T12._IDRRef)))) AND T12._IDRRef IN
- (SELECT
- T14._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T14
- INNER JOIN dbo._InfoRg9937 T15
- ON ((T15._Fld9939_TYPE = 0x08 AND T15._Fld9939_RTRef = 0x00000095 AND T15._Fld9939_RRRef = ?) AND (T15._Fld9938_TYPE = T14._Fld784_TYPE AND T15._Fld9938_RTRef = T14._Fld784_RTRef AND T15._Fld9938_RRRef = T14._Fld784_RRRef))
- WHERE ((T14._Fld595 = ?)) AND (T15._Fld595 = ?)))
- WHERE ((T12._Fld595 = ?)) AND ((CASE WHEN T10._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T16
- WHERE ((T16._Fld595 = ?)) AND ((T16._Fld12072RRef = T12._IDRRef) AND (T16._Fld12073_TYPE = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x08 END AND T16._Fld12073_RTRef = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T16._Fld12073_RRRef = T10._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T17
- WHERE ((T17._Fld595 = ?)) AND ((T17._Fld12199RRef = T12._IDRRef) AND T17._Fld12200_TYPE = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x08 END AND T17._Fld12200_RTRef = CASE WHEN T10._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T17._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T9._Fld11496RRef AS Fld11496RRef,
- T9._Fld595 AS Fld595_,
- T9._Period AS Period_,
- T9._Fld11503 AS Fld11503_,
- T9._Fld11497RRef AS Fld11497RRef,
- T9._Fld11494RRef AS Fld11494RRef
- FROM dbo._AccumRgT11507 T9
- WHERE (T9._Period = ? AND T9._Fld11494RRef = ? AND T9._Fld11496RRef = ? AND T9._Fld11503 <> ? AND T9._Fld11503 <> ?) AND (T9._Fld595 = ?)) T8
- WHERE T8.Period_ = ? AND (((T8.Fld11494RRef = ?) AND (T8.Fld11496RRef = ?))) AND (T8.Fld11503_ <> ?) AND (T8.Fld11503_ <> ?)
- GROUP BY T8.Fld11497RRef
- HAVING (CAST(SUM(T8.Fld11503_) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- MIN(T18.SDBL_RLS_SIGNAL_) AS SDBL_RLS_SIGNAL_,
- T18.Fld11497RRef AS Fld11497RRef,
- CAST(CAST(SUM(CASE WHEN T18.RecordKind_ = 0.0 THEN -T18.Fld11503_ ELSE T18.Fld11503_ END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld11503Balance_
- FROM (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T20
- ON ((T19._Fld11496RRef = T20._IDRRef)) AND (T20._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T21
- INNER JOIN dbo._Reference21 T22
- ON (((T21._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T23
- WHERE ((T23._Fld595 = ?)) AND ((T23._Fld12065RRef = T21._IDRRef) AND (T23._Fld12066RRef = T22._IDRRef)))) AND T22._IDRRef IN
- (SELECT
- T24._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T24
- INNER JOIN dbo._InfoRg9937 T25
- ON ((T25._Fld9939_TYPE = 0x08 AND T25._Fld9939_RTRef = 0x00000095 AND T25._Fld9939_RRRef = ?) AND (T25._Fld9938_TYPE = T24._Fld784_TYPE AND T25._Fld9938_RTRef = T24._Fld784_RTRef AND T25._Fld9938_RRRef = T24._Fld784_RRRef))
- WHERE ((T24._Fld595 = ?)) AND (T25._Fld595 = ?)))
- WHERE ((T22._Fld595 = ?)) AND ((CASE WHEN T20._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T26
- WHERE ((T26._Fld595 = ?)) AND ((T26._Fld12072RRef = T22._IDRRef) AND (T26._Fld12073_TYPE = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x08 END AND T26._Fld12073_RTRef = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T26._Fld12073_RRRef = T20._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T27
- WHERE ((T27._Fld595 = ?)) AND ((T27._Fld12199RRef = T22._IDRRef) AND T27._Fld12200_TYPE = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x08 END AND T27._Fld12200_RTRef = CASE WHEN T20._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T27._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T19._Period AS Period_,
- T19._Fld11494RRef AS Fld11494RRef,
- T19._Fld11496RRef AS Fld11496RRef,
- T19._Fld595 AS Fld595_,
- T19._Fld11497RRef AS Fld11497RRef,
- T19._Fld11503 AS Fld11503_,
- T19._RecordKind AS RecordKind_,
- T19._Active AS Active_
- FROM dbo._AccumRg11493 T19
- WHERE (T19._Period >= ? AND T19._Period < ? AND T19._Fld11494RRef = ? AND T19._Fld11496RRef = ?) AND (T19._Fld595 = ?)) T18
- WHERE T18.Period_ >= ? AND T18.Period_ < ? AND T18.Active_ = 0x01 AND (((T18.Fld11494RRef = ?) AND (T18.Fld11496RRef = ?)))
- GROUP BY T18.Fld11497RRef
- HAVING (CAST(CAST(SUM(CASE WHEN T18.RecordKind_ = 0.0 THEN -T18.Fld11503_ ELSE T18.Fld11503_ END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T7
- GROUP BY T7.Fld11497RRef
- HAVING (CAST(SUM(T7.Fld11503Balance_) AS NUMERIC(38, 8))) <> 0.0) T6
- LEFT OUTER JOIN dbo._Reference43 T28
- ON (T6.Fld11497RRef = T28._IDRRef) AND (T28._Fld595 = ?)
- LEFT OUTER JOIN #tt T29 WITH(NOLOCK)
- ON (T28._Fld1083RRef = T29._Q_000_F_000RRef)
- ON CASE WHEN (T5._Q_001_F_000RRef = ?) THEN 0x01 ELSE CASE WHEN (T5._Q_001_F_000RRef = T6.Fld11497RRef) THEN 0x01 WHEN NOT (T5._Q_001_F_000RRef = T6.Fld11497RRef) THEN 0x00 END END = 0x01
- WHERE ((T5._Q_001_F_001RRef = ?)) AND CASE WHEN (T28._IDRRef = T28._IDRRef OR T28._IDRRef IS NULL) AND (T29._Q_000_F_000RRef = T29._Q_000_F_000RRef OR T29._Q_000_F_000RRef IS NULL) AND (T5._Q_001_F_001RRef = ?) THEN CASE WHEN ISNULL(T6.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0 ELSE 2000000000 END + 2000000000 ELSE 0 END = 2000000000
- GROUP BY T5._Q_001_F_001RRef,
- T5._Q_001_F_002,
- T5._Q_001_F_000RRef,
- T5._Q_001_F_003RRef
- UNION ALL SELECT
- T30._Q_001_F_001RRef,
- T30._Q_001_F_002,
- T30._Q_001_F_003RRef,
- CAST(SUM(ISNULL(CAST(CASE WHEN (T30._Q_001_F_000RRef = 0x00000000000000000000000000000000) THEN CAST(((CAST((CAST(T31.Fld11330Turnover_ AS NUMERIC(26, 2)) * CAST(T36._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T30._Q_001_F_005 AS NUMERIC(8, 0))) / (T30._Q_001_F_004 * ISNULL(CAST(T36._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) ELSE T31.Fld11330Turnover_ END AS NUMERIC(33, 2)),0.0)) AS NUMERIC(38, 8)),
- T30._Q_001_F_000RRef
- FROM #tt T30 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- MIN(T32.SDBL_RLS_SIGNAL_) AS SDBL_RLS_SIGNAL_,
- T32.Fld11326RRef AS Fld11326RRef,
- CAST(SUM(T32.Fld11330Turnover_) AS NUMERIC(38, 8)) AS Fld11330Turnover_
- FROM (SELECT
- 0x01 AS SDBL_RLS_SIGNAL_,
- T33._Fld11326RRef AS Fld11326RRef,
- CAST(SUM(T33._Fld11330) AS NUMERIC(33, 8)) AS Fld11330Turnover_
- FROM dbo._AccumRgTn11332 T33
- WHERE ((T33._Fld595 = ?)) AND (T33._Period < ? AND (((T33._Fld11324RRef = ?) AND (T33._Fld11325RRef = ?))) AND (T33._Fld11330 <> ?))
- GROUP BY T33._Fld11326RRef
- HAVING (CAST(SUM(T33._Fld11330) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- 0x01 AS SDBL_RLS_SIGNAL_,
- T34._Fld11326RRef AS Fld11326RRef,
- CAST(CAST(SUM(T34._Fld11330) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld11330Turnover_
- FROM dbo._AccumRg11323 T34
- WHERE ((T34._Fld595 = ?)) AND (T34._Period >= ? AND T34._Period <= ? AND T34._Active = 0x01 AND (((T34._Fld11324RRef = ?) AND (T34._Fld11325RRef = ?))))
- GROUP BY T34._Fld11326RRef
- HAVING (CAST(CAST(SUM(T34._Fld11330) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T32
- GROUP BY T32.Fld11326RRef
- HAVING (CAST(SUM(T32.Fld11330Turnover_) AS NUMERIC(38, 8))) <> 0.0) T31
- LEFT OUTER JOIN dbo._Reference43 T35
- ON (T31.Fld11326RRef = T35._IDRRef) AND (T35._Fld595 = ?)
- LEFT OUTER JOIN #tt T36 WITH(NOLOCK)
- ON (T35._Fld1083RRef = T36._Q_000_F_000RRef)
- ON CASE WHEN (T30._Q_001_F_000RRef = ?) THEN 0x01 ELSE CASE WHEN (T30._Q_001_F_000RRef = T31.Fld11326RRef) THEN 0x01 WHEN NOT (T30._Q_001_F_000RRef = T31.Fld11326RRef) THEN 0x00 END END = 0x01
- WHERE (T30._Q_001_F_001RRef = ?)
- GROUP BY T30._Q_001_F_001RRef,
- T30._Q_001_F_002,
- T30._Q_001_F_000RRef,
- T30._Q_001_F_003RRef
- UNION ALL SELECT
- T37._Q_001_F_001RRef,
- T37._Q_001_F_002,
- T37._Q_001_F_003RRef,
- CAST(CAST(SUM(ISNULL(CAST(CAST(((CAST((CAST(T38.Fld11255Turnover_ AS NUMERIC(26, 2)) * CAST(T92._Q_000_F_001 AS NUMERIC(11, 6))) AS NUMERIC(29, 8)) * CAST(T37._Q_001_F_005 AS NUMERIC(8, 0))) / (T37._Q_001_F_004 * ISNULL(CAST(T92._Q_000_F_002 AS NUMERIC(10, 0)),1.0))) AS NUMERIC(15, 2)) AS NUMERIC(15, 2)),0.0)) AS NUMERIC(27, 8)) AS NUMERIC(38, 8)),
- T37._Q_001_F_000RRef
- FROM #tt T37 WITH(NOLOCK)
- LEFT OUTER JOIN (SELECT
- MIN(ISNULL(T39.SDBL_RLS_SIGNAL_,0x01)) AS SDBL_RLS_SIGNAL_,
- T39.Fld11251_TYPE AS Fld11251_TYPE,
- T39.Fld11251_RTRef AS Fld11251_RTRef,
- T39.Fld11251_RRRef AS Fld11251_RRRef,
- CAST(SUM(T39.Fld11255Turnover_) AS NUMERIC(38, 8)) AS Fld11255Turnover_
- FROM (SELECT
- MIN(CASE WHEN ISNULL(T42.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T52.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0x01 ELSE 0x00 END) AS SDBL_RLS_SIGNAL_,
- T40._Fld11251_TYPE AS Fld11251_TYPE,
- T40._Fld11251_RTRef AS Fld11251_RTRef,
- T40._Fld11251_RRRef AS Fld11251_RRRef,
- CAST(SUM(T40._Fld11255) AS NUMERIC(33, 8)) AS Fld11255Turnover_
- FROM dbo._AccumRgTn11257 T40
- LEFT OUTER JOIN dbo._Document218 T41
- ON (T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000DA AND T40._Fld11251_RRRef = T41._IDRRef) AND (T41._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T44
- ON ((T43._Fld4625RRef = T44._IDRRef)) AND (T44._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T45
- INNER JOIN dbo._Reference21 T46
- ON (((T45._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T47
- WHERE ((T47._Fld595 = ?)) 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 = ?) AND (T49._Fld9938_TYPE = T48._Fld784_TYPE AND T49._Fld9938_RTRef = T48._Fld784_RTRef AND T49._Fld9938_RRRef = T48._Fld784_RRRef))
- WHERE ((T48._Fld595 = ?)) AND (T49._Fld595 = ?)))
- WHERE ((T46._Fld595 = ?)) 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 = ?)) 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 = ?)) 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))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T43._IDRRef AS IDRRef,
- T43._Fld4625RRef AS Fld4625RRef,
- T43._Fld595 AS Fld595_
- FROM dbo._Document233 T43
- WHERE (T43._Fld595 = ?)) T42
- ON T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000E9 AND T40._Fld11251_RRRef = T42.IDRRef
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T54
- ON ((T53._Fld4774RRef = T54._IDRRef)) AND (T54._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T55
- INNER JOIN dbo._Reference21 T56
- ON (((T55._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T57
- WHERE ((T57._Fld595 = ?)) AND ((T57._Fld12065RRef = T55._IDRRef) AND (T57._Fld12066RRef = T56._IDRRef)))) AND T56._IDRRef IN
- (SELECT
- T58._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T58
- INNER JOIN dbo._InfoRg9937 T59
- ON ((T59._Fld9939_TYPE = 0x08 AND T59._Fld9939_RTRef = 0x00000095 AND T59._Fld9939_RRRef = ?) AND (T59._Fld9938_TYPE = T58._Fld784_TYPE AND T59._Fld9938_RTRef = T58._Fld784_RTRef AND T59._Fld9938_RRRef = T58._Fld784_RRRef))
- WHERE ((T58._Fld595 = ?)) AND (T59._Fld595 = ?)))
- WHERE ((T56._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T60
- WHERE ((T60._Fld595 = ?)) AND ((T60._Fld12072RRef = T56._IDRRef) AND (T60._Fld12073_TYPE = 0x08 AND T60._Fld12073_RTRef = 0x0000001C AND T60._Fld12073_RRRef = T53._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T61
- WHERE ((T61._Fld595 = ?)) AND ((T61._Fld12199RRef = T56._IDRRef) AND T61._Fld12200_TYPE = 0x08 AND T61._Fld12200_RTRef = 0x0000001C AND (T61._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T54._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T62
- WHERE ((T62._Fld595 = ?)) AND ((T62._Fld12072RRef = T56._IDRRef) AND (T62._Fld12073_TYPE = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x08 END AND T62._Fld12073_RTRef = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T62._Fld12073_RRRef = T54._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T63
- WHERE ((T63._Fld595 = ?)) AND ((T63._Fld12199RRef = T56._IDRRef) AND T63._Fld12200_TYPE = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x08 END AND T63._Fld12200_RTRef = CASE WHEN T54._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T63._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T53._IDRRef AS IDRRef,
- T53._Fld4774RRef AS Fld4774RRef,
- T53._Fld4779RRef AS Fld4779RRef,
- T53._Fld595 AS Fld595_
- FROM dbo._Document234 T53
- WHERE (T53._Fld595 = ?)) T52
- ON T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000EA AND T40._Fld11251_RRRef = T52.IDRRef
- LEFT OUTER JOIN dbo._Document286 T64
- ON (T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x0000011E AND T40._Fld11251_RRRef = T64._IDRRef) AND (T64._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T65
- ON (T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000C7 AND T40._Fld11251_RRRef = T65._IDRRef) AND (T65._Fld595 = ?)
- WHERE ((T40._Fld595 = ?)) AND (T40._Period < ? AND (((T40._Fld11246RRef = ?) AND (CASE WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000DA THEN T41._Fld4083RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000E9 THEN T42.Fld4625RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000EA THEN T52.Fld4774RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x0000011E THEN T64._Fld7289RRef WHEN T40._Fld11251_TYPE = 0x08 AND T40._Fld11251_RTRef = 0x000000C7 THEN T65._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = ?))) AND (T40._Fld11255 <> ?))
- GROUP BY T40._Fld11251_TYPE,
- T40._Fld11251_RTRef,
- T40._Fld11251_RRRef
- HAVING (CAST(SUM(T40._Fld11255) AS NUMERIC(33, 8))) <> 0.0
- UNION ALL SELECT
- MIN(CASE WHEN ISNULL(T68.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T78.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0x01 ELSE 0x00 END) AS SDBL_RLS_SIGNAL_,
- T66._Fld11251_TYPE AS Fld11251_TYPE,
- T66._Fld11251_RTRef AS Fld11251_RTRef,
- T66._Fld11251_RRRef AS Fld11251_RRRef,
- CAST(CAST(SUM(T66._Fld11255) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld11255Turnover_
- FROM dbo._AccumRg11245 T66
- LEFT OUTER JOIN dbo._Document218 T67
- ON (T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000DA AND T66._Fld11251_RRRef = T67._IDRRef) AND (T67._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T70
- ON ((T69._Fld4625RRef = T70._IDRRef)) AND (T70._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T71
- INNER JOIN dbo._Reference21 T72
- ON (((T71._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T73
- WHERE ((T73._Fld595 = ?)) AND ((T73._Fld12065RRef = T71._IDRRef) AND (T73._Fld12066RRef = T72._IDRRef)))) AND T72._IDRRef IN
- (SELECT
- T74._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T74
- INNER JOIN dbo._InfoRg9937 T75
- ON ((T75._Fld9939_TYPE = 0x08 AND T75._Fld9939_RTRef = 0x00000095 AND T75._Fld9939_RRRef = ?) AND (T75._Fld9938_TYPE = T74._Fld784_TYPE AND T75._Fld9938_RTRef = T74._Fld784_RTRef AND T75._Fld9938_RRRef = T74._Fld784_RRRef))
- WHERE ((T74._Fld595 = ?)) AND (T75._Fld595 = ?)))
- WHERE ((T72._Fld595 = ?)) AND ((CASE WHEN T70._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T76
- WHERE ((T76._Fld595 = ?)) AND ((T76._Fld12072RRef = T72._IDRRef) AND (T76._Fld12073_TYPE = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x08 END AND T76._Fld12073_RTRef = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T76._Fld12073_RRRef = T70._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T77
- WHERE ((T77._Fld595 = ?)) AND ((T77._Fld12199RRef = T72._IDRRef) AND T77._Fld12200_TYPE = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x08 END AND T77._Fld12200_RTRef = CASE WHEN T70._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T77._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T69._IDRRef AS IDRRef,
- T69._Fld4625RRef AS Fld4625RRef,
- T69._Fld595 AS Fld595_
- FROM dbo._Document233 T69
- WHERE (T69._Fld595 = ?)) T68
- ON T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000E9 AND T66._Fld11251_RRRef = T68.IDRRef
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T80
- ON ((T79._Fld4774RRef = T80._IDRRef)) AND (T80._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T81
- INNER JOIN dbo._Reference21 T82
- ON (((T81._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T83
- WHERE ((T83._Fld595 = ?)) AND ((T83._Fld12065RRef = T81._IDRRef) AND (T83._Fld12066RRef = T82._IDRRef)))) AND T82._IDRRef IN
- (SELECT
- T84._Reference21_IDRRef AS Q_007_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 = ?) AND (T85._Fld9938_TYPE = T84._Fld784_TYPE AND T85._Fld9938_RTRef = T84._Fld784_RTRef AND T85._Fld9938_RRRef = T84._Fld784_RRRef))
- WHERE ((T84._Fld595 = ?)) AND (T85._Fld595 = ?)))
- WHERE ((T82._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T86
- WHERE ((T86._Fld595 = ?)) AND ((T86._Fld12072RRef = T82._IDRRef) AND (T86._Fld12073_TYPE = 0x08 AND T86._Fld12073_RTRef = 0x0000001C AND T86._Fld12073_RRRef = T79._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T87
- WHERE ((T87._Fld595 = ?)) AND ((T87._Fld12199RRef = T82._IDRRef) AND T87._Fld12200_TYPE = 0x08 AND T87._Fld12200_RTRef = 0x0000001C AND (T87._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) 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_004_F_000_
- FROM dbo._InfoRg11710 T88
- WHERE ((T88._Fld595 = ?)) AND ((T88._Fld12072RRef = T82._IDRRef) AND (T88._Fld12073_TYPE = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END AND T88._Fld12073_RTRef = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T88._Fld12073_RRRef = T80._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T89
- WHERE ((T89._Fld595 = ?)) AND ((T89._Fld12199RRef = T82._IDRRef) AND T89._Fld12200_TYPE = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x08 END AND T89._Fld12200_RTRef = CASE WHEN T80._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T89._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T79._IDRRef AS IDRRef,
- T79._Fld4774RRef AS Fld4774RRef,
- T79._Fld4779RRef AS Fld4779RRef,
- T79._Fld595 AS Fld595_
- FROM dbo._Document234 T79
- WHERE (T79._Fld595 = ?)) T78
- ON T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000EA AND T66._Fld11251_RRRef = T78.IDRRef
- LEFT OUTER JOIN dbo._Document286 T90
- ON (T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x0000011E AND T66._Fld11251_RRRef = T90._IDRRef) AND (T90._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T91
- ON (T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000C7 AND T66._Fld11251_RRRef = T91._IDRRef) AND (T91._Fld595 = ?)
- WHERE ((T66._Fld595 = ?)) AND (T66._Period >= ? AND T66._Period <= ? AND T66._Active = 0x01 AND (((T66._Fld11246RRef = ?) AND (CASE WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000DA THEN T67._Fld4083RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000E9 THEN T68.Fld4625RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000EA THEN T78.Fld4774RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x0000011E THEN T90._Fld7289RRef WHEN T66._Fld11251_TYPE = 0x08 AND T66._Fld11251_RTRef = 0x000000C7 THEN T91._Fld2840RRef ELSE CAST(NULL AS BINARY(16)) END = ?))))
- GROUP BY T66._Fld11251_TYPE,
- T66._Fld11251_RTRef,
- T66._Fld11251_RRRef
- HAVING (CAST(CAST(SUM(T66._Fld11255) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T39
- GROUP BY T39.Fld11251_TYPE,
- T39.Fld11251_RTRef,
- T39.Fld11251_RRRef
- HAVING (CAST(SUM(T39.Fld11255Turnover_) AS NUMERIC(38, 8))) <> 0.0) T38
- LEFT OUTER JOIN #tt T92 WITH(NOLOCK)
- ON (T92._Q_000_F_000RRef = ?)
- LEFT OUTER JOIN dbo._Document218 T93
- ON (T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000DA AND T38.Fld11251_RRRef = T93._IDRRef) AND (T93._Fld595 = ?)
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T96
- ON ((T95._Fld4625RRef = T96._IDRRef)) AND (T96._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T97
- INNER JOIN dbo._Reference21 T98
- ON (((T97._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T99
- WHERE ((T99._Fld595 = ?)) AND ((T99._Fld12065RRef = T97._IDRRef) AND (T99._Fld12066RRef = T98._IDRRef)))) AND T98._IDRRef IN
- (SELECT
- T100._Reference21_IDRRef AS Q_005_F_000RRef
- FROM dbo._Reference21_VT782 T100
- INNER JOIN dbo._InfoRg9937 T101
- ON ((T101._Fld9939_TYPE = 0x08 AND T101._Fld9939_RTRef = 0x00000095 AND T101._Fld9939_RRRef = ?) AND (T101._Fld9938_TYPE = T100._Fld784_TYPE AND T101._Fld9938_RTRef = T100._Fld784_RTRef AND T101._Fld9938_RRRef = T100._Fld784_RRRef))
- WHERE ((T100._Fld595 = ?)) AND (T101._Fld595 = ?)))
- WHERE ((T98._Fld595 = ?)) AND ((CASE WHEN T96._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T102
- WHERE ((T102._Fld595 = ?)) AND ((T102._Fld12072RRef = T98._IDRRef) AND (T102._Fld12073_TYPE = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x08 END AND T102._Fld12073_RTRef = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T102._Fld12073_RRRef = T96._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T103
- WHERE ((T103._Fld595 = ?)) AND ((T103._Fld12199RRef = T98._IDRRef) AND T103._Fld12200_TYPE = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x08 END AND T103._Fld12200_RTRef = CASE WHEN T96._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T103._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T95._IDRRef AS IDRRef,
- T95._Fld4625RRef AS Fld4625RRef,
- T95._Fld4627RRef AS Fld4627RRef,
- T95._Fld595 AS Fld595_
- FROM dbo._Document233 T95
- WHERE (T95._Fld595 = ?)) T94
- ON T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000E9 AND T38.Fld11251_RRRef = T94.IDRRef
- LEFT OUTER JOIN (SELECT
- CASE WHEN (EXISTS(SELECT
- 1
- FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
- LEFT OUTER JOIN dbo._Reference42 T106
- ON ((T105._Fld4774RRef = T106._IDRRef)) AND (T106._Fld595 = ?)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T107
- INNER JOIN dbo._Reference21 T108
- ON (((T107._Fld1685 = ?) AND EXISTS(SELECT
- 0x01 AS Q_006_F_000_
- FROM dbo._InfoRg11709 T109
- WHERE ((T109._Fld595 = ?)) AND ((T109._Fld12065RRef = T107._IDRRef) AND (T109._Fld12066RRef = T108._IDRRef)))) AND T108._IDRRef IN
- (SELECT
- T110._Reference21_IDRRef AS Q_007_F_000RRef
- FROM dbo._Reference21_VT782 T110
- INNER JOIN dbo._InfoRg9937 T111
- ON ((T111._Fld9939_TYPE = 0x08 AND T111._Fld9939_RTRef = 0x00000095 AND T111._Fld9939_RRRef = ?) AND (T111._Fld9938_TYPE = T110._Fld784_TYPE AND T111._Fld9938_RTRef = T110._Fld784_RTRef AND T111._Fld9938_RRRef = T110._Fld784_RRRef))
- WHERE ((T110._Fld595 = ?)) AND (T111._Fld595 = ?)))
- WHERE ((T108._Fld595 = ?)) AND ((0x08 <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_002_F_000_
- FROM dbo._InfoRg11710 T112
- WHERE ((T112._Fld595 = ?)) AND ((T112._Fld12072RRef = T108._IDRRef) AND (T112._Fld12073_TYPE = 0x08 AND T112._Fld12073_RTRef = 0x0000001C AND T112._Fld12073_RRRef = T105._Fld4779RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_003_F_000_
- FROM dbo._InfoRg11715 T113
- WHERE ((T113._Fld595 = ?)) AND ((T113._Fld12199RRef = T108._IDRRef) AND T113._Fld12200_TYPE = 0x08 AND T113._Fld12200_RTRef = 0x0000001C AND (T113._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END) AND (CASE WHEN T106._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11710 T114
- WHERE ((T114._Fld595 = ?)) AND ((T114._Fld12072RRef = T108._IDRRef) AND (T114._Fld12073_TYPE = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x08 END AND T114._Fld12073_RTRef = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T114._Fld12073_RRRef = T106._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
- 0x01 AS Q_005_F_000_
- FROM dbo._InfoRg11715 T115
- WHERE ((T115._Fld595 = ?)) AND ((T115._Fld12199RRef = T108._IDRRef) AND T115._Fld12200_TYPE = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x08 END AND T115._Fld12200_RTRef = CASE WHEN T106._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T115._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END))))) THEN 0x01 ELSE 0x00 END AS SDBL_RLS_SIGNAL_,
- T105._IDRRef AS IDRRef,
- T105._Fld4774RRef AS Fld4774RRef,
- T105._Fld4779RRef AS Fld4779RRef,
- T105._Fld595 AS Fld595_,
- T105._Fld4776RRef AS Fld4776RRef
- FROM dbo._Document234 T105
- WHERE (T105._Fld595 = ?)) T104
- ON T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000EA AND T38.Fld11251_RRRef = T104.IDRRef
- LEFT OUTER JOIN dbo._Document286 T116
- ON (T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x0000011E AND T38.Fld11251_RRRef = T116._IDRRef) AND (T116._Fld595 = ?)
- LEFT OUTER JOIN dbo._Document199 T117
- ON (T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000C7 AND T38.Fld11251_RRRef = T117._IDRRef) AND (T117._Fld595 = ?)
- ON CASE WHEN (T37._Q_001_F_000RRef = ?) THEN 0x01 ELSE CASE WHEN (T37._Q_001_F_000RRef = CASE WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000DA THEN T93._Fld4084RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000E9 THEN T94.Fld4627RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000EA THEN T104.Fld4776RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x0000011E THEN T116._Fld7290RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000C7 THEN T117._Fld2841RRef ELSE CAST(NULL AS BINARY(16)) END) THEN 0x01 WHEN NOT (T37._Q_001_F_000RRef = CASE WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000DA THEN T93._Fld4084RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000E9 THEN T94.Fld4627RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000EA THEN T104.Fld4776RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x0000011E THEN T116._Fld7290RRef WHEN T38.Fld11251_TYPE = 0x08 AND T38.Fld11251_RTRef = 0x000000C7 THEN T117._Fld2841RRef ELSE CAST(NULL AS BINARY(16)) END) THEN 0x00 END END = 0x01
- WHERE ((T37._Q_001_F_001RRef = ?)) AND CASE WHEN (T92._Q_000_F_000RRef = T92._Q_000_F_000RRef OR T92._Q_000_F_000RRef IS NULL) AND (T93._IDRRef = T93._IDRRef OR T93._IDRRef IS NULL) AND (T116._IDRRef = T116._IDRRef OR T116._IDRRef IS NULL) AND (T117._IDRRef = T117._IDRRef OR T117._IDRRef IS NULL) AND (T37._Q_001_F_001RRef = ?) THEN CASE WHEN ISNULL(T38.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T94.SDBL_RLS_SIGNAL_,0x01) = 0x01 AND ISNULL(T104.SDBL_RLS_SIGNAL_,0x01) = 0x01 THEN 0 ELSE 2000000000 END + 2000000000 ELSE 0 END = 2000000000
- GROUP BY T37._Q_001_F_001RRef,
- T37._Q_001_F_002,
- T37._Q_001_F_000RRef,
- T37._Q_001_F_003RRef
- ",Context='Form.Call : Document.InventoryExpense.Form.DocumentForm.Module.GetCreditLimit
- ShajiAutoPaints_BIT Document.InventoryExpense.Form.DocumentForm.Form : 761 : QueryResult = Query.Execute();'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement