Advertisement
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,
- 5.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 = @P1)) 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 = @P2)
- 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 = @P3)
- 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 = @P4)
- 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 = @P5)
- 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 = @P6)
- 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 = @P7)
- 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 = @P8)
- 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 = @P9)
- 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 = @P10)
- WHERE EXISTS(SELECT
- 0x01 AS Q_001_F_000_
- FROM dbo._Reference98 T12
- INNER JOIN dbo._Reference21 T13
- ON (((T12._Fld1685 = @P11) AND EXISTS(SELECT
- 0x01 AS Q_004_F_000_
- FROM dbo._InfoRg11709 T14
- WHERE ((T14._Fld595 = @P12)) 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 = @P13) AND (T16._Fld9938_TYPE = T15._Fld784_TYPE AND T16._Fld9938_RTRef = T15._Fld784_RTRef AND T16._Fld9938_RRRef = T15._Fld784_RRRef))
- WHERE ((T15._Fld595 = @P14)) AND (T16._Fld595 = @P15)))
- WHERE ((T13._Fld595 = @P16)) 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 = @P17)) 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._Fld
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement