bytecoded

Top 2 Query

Nov 4th, 2019
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.57 KB | None | 0 0
  1. 49.190=TotalDurationSec,1.200=AvgDurationSec,41=Execs,,4,Sql="SELECT TOP 25
  2. T1._IDRRef,
  3. T1._Marked,
  4. T1._Number,
  5. T1._Date_Time,
  6. T1._Posted,
  7. T1._Fld4621RRef,
  8. T1._Fld4622RRef,
  9. T1._Fld4625RRef,
  10. T1._Fld4627RRef,
  11. T1._Fld4633,
  12. T1._Fld4635RRef,
  13. T1._Fld4657RRef,
  14. CASE WHEN ((T1._Fld4657RRef = 0xAEB7F7D9237C245A447AADE98F164CDF) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T14.Fld10346Balance_ AS NUMERIC(33, 2)),0.0) > 0.0) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 4.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 6.0 ELSE 5.0 END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 0.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 2.0 ELSE 1.0 END END ELSE 7.0 END,
  15. T19._Fld12313RRef,
  16. T1._Fld13369,
  17. CASE WHEN ((ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) > 0.0) THEN (ISNULL(CAST(T20.Fld10335Balance_ AS NUMERIC(27, 2)),0.0) + ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) ELSE 0.0 END,
  18. CASE WHEN (T1._Fld4657RRef = 0xAEB7F7D9237C245A447AADE98F164CDF) THEN CASE WHEN T1._Posted = 0x01 THEN CASE WHEN T1._Fld14039 = 0x01 THEN CASE WHEN (ISNULL(CAST(T30.Fld14035Expense_ AS NUMERIC(21, 3)),0.0) <= 0.0) THEN 0.0 WHEN ((CAST(ISNULL(CAST(T30.Fld14035Expense_ AS NUMERIC(21, 3)),0.0) AS NUMERIC(26, 8)) / ISNULL(CAST(T30.Fld14035Receipt_ AS NUMERIC(21, 3)),0.0)) <= 0.5) THEN 1.0 WHEN ((CAST(ISNULL(CAST(T30.Fld14035Expense_ AS NUMERIC(21, 3)),0.0) AS NUMERIC(26, 8)) / ISNULL(CAST(T30.Fld14035Receipt_ AS NUMERIC(21, 3)),0.0)) < 1.0) THEN 2.0 WHEN ((CAST(ISNULL(CAST(T30.Fld14035Expense_ AS NUMERIC(21, 3)),0.0) AS NUMERIC(26, 8)) / ISNULL(CAST(T30.Fld14035Receipt_ AS NUMERIC(21, 3)),0.0)) >= 1.0) THEN 3.0 END ELSE 3.0 END ELSE 0.0 END ELSE 7.0 END,
  19. T32._Fld1191
  20. FROM dbo._Document233 T1
  21. LEFT OUTER JOIN (SELECT
  22. T3._Fld11328RRef AS Fld11328RRef,
  23. CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8)) AS Fld11330Turnover_
  24. FROM dbo._AccumRgTn11332 T3
  25. WHERE ((T3._Fld595 = ?)) AND ((T3._Fld11330 <> ?))
  26. GROUP BY T3._Fld11328RRef
  27. HAVING (CAST(SUM(T3._Fld11330) AS NUMERIC(33, 8))) <> 0.0) T2
  28. ON (T1._IDRRef = T2.Fld11328RRef)
  29. LEFT OUTER JOIN (SELECT
  30. T5._Fld10540_TYPE AS Fld10540_TYPE,
  31. T5._Fld10540_RTRef AS Fld10540_RTRef,
  32. T5._Fld10540_RRRef AS Fld10540_RRRef,
  33. CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8)) AS Fld10545Balance_
  34. FROM dbo._AccumRgT10549 T5
  35. WHERE (((T5._Fld595 = ?)) AND (EXISTS(SELECT
  36. 1
  37. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  38. LEFT OUTER JOIN dbo._Reference42 T6
  39. ON ((T5._Fld10538RRef = T6._IDRRef)) AND (T6._Fld595 = ?)
  40. WHERE EXISTS(SELECT
  41. 0x01 AS Q_001_F_000_
  42. FROM dbo._Reference98 T7
  43. INNER JOIN dbo._Reference21 T8
  44. ON (((T7._Fld1685 = ?) AND EXISTS(SELECT
  45. 0x01 AS Q_004_F_000_
  46. FROM dbo._InfoRg11709 T9
  47. WHERE ((T9._Fld595 = ?)) AND ((T9._Fld12065RRef = T7._IDRRef) AND (T9._Fld12066RRef = T8._IDRRef)))) AND T8._IDRRef IN
  48. (SELECT
  49. T10._Reference21_IDRRef AS Q_005_F_000RRef
  50. FROM dbo._Reference21_VT782 T10
  51. INNER JOIN dbo._InfoRg9937 T11
  52. ON ((T11._Fld9939_TYPE = 0x08 AND T11._Fld9939_RTRef = 0x00000095 AND T11._Fld9939_RRRef = ?) AND (T11._Fld9938_TYPE = T10._Fld784_TYPE AND T11._Fld9938_RTRef = T10._Fld784_RTRef AND T11._Fld9938_RRRef = T10._Fld784_RRRef))
  53. WHERE ((T10._Fld595 = ?)) AND (T11._Fld595 = ?)))
  54. WHERE ((T8._Fld595 = ?)) AND ((CASE WHEN T6._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  55. 0x01 AS Q_002_F_000_
  56. FROM dbo._InfoRg11710 T12
  57. WHERE ((T12._Fld595 = ?)) AND ((T12._Fld12072RRef = T8._IDRRef) AND (T12._Fld12073_TYPE = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END AND T12._Fld12073_RTRef = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T12._Fld12073_RRRef = T6._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  58. 0x01 AS Q_003_F_000_
  59. FROM dbo._InfoRg11715 T13
  60. WHERE ((T13._Fld595 = ?)) AND ((T13._Fld12199RRef = T8._IDRRef) AND T13._Fld12200_TYPE = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x08 END AND T13._Fld12200_RTRef = CASE WHEN T6._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T13._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T5._Period = ? AND (T5._Fld10545 <> ?) AND (T5._Fld10545 <> ?))
  61. GROUP BY T5._Fld10540_TYPE,
  62. T5._Fld10540_RTRef,
  63. T5._Fld10540_RRRef
  64. HAVING (CAST(SUM(T5._Fld10545) AS NUMERIC(33, 8))) <> 0.0) T4
  65. ON (0x08 = T4.Fld10540_TYPE AND 0x000000E9 = T4.Fld10540_RTRef AND T1._IDRRef = T4.Fld10540_RRRef)
  66. LEFT OUTER JOIN (SELECT
  67. T15.Fld10344RRef AS Fld10344RRef,
  68. CAST(SUM(T15.Fld10346Balance_) AS NUMERIC(38, 8)) AS Fld10346Balance_
  69. FROM (SELECT
  70. T16._Fld10344RRef AS Fld10344RRef,
  71. CAST(SUM(T16._Fld10346) AS NUMERIC(33, 8)) AS Fld10346Balance_
  72. FROM dbo._AccumRgT10349 T16
  73. WHERE ((T16._Fld595 = ?)) AND (T16._Period = ? AND (T16._Fld10346 <> ?) AND (T16._Fld10346 <> ?))
  74. GROUP BY T16._Fld10344RRef
  75. HAVING (CAST(SUM(T16._Fld10346) AS NUMERIC(33, 8))) <> 0.0
  76. UNION ALL SELECT
  77. T17._Fld10344RRef AS Fld10344RRef,
  78. CAST(CAST(SUM(CASE WHEN T17._RecordKind = 0.0 THEN -T17._Fld10346 ELSE T17._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2)) AS Fld10346Balance_
  79. FROM dbo._AccumRg10339 T17
  80. WHERE ((T17._Fld595 = ?)) AND (T17._Period >= ? AND T17._Period < ? AND T17._Active = 0x01)
  81. GROUP BY T17._Fld10344RRef
  82. HAVING (CAST(CAST(SUM(CASE WHEN T17._RecordKind = 0.0 THEN -T17._Fld10346 ELSE T17._Fld10346 END) AS NUMERIC(27, 8)) AS NUMERIC(27, 2))) <> 0.0) T15
  83. GROUP BY T15.Fld10344RRef
  84. HAVING (CAST(SUM(T15.Fld10346Balance_) AS NUMERIC(38, 8))) <> 0.0) T14
  85. ON (T1._IDRRef = T14.Fld10344RRef)
  86. LEFT OUTER JOIN dbo._InfoRg9134 T18
  87. ON ((0x08 = T18._Fld9136_TYPE AND 0x000000E9 = T18._Fld9136_RTRef AND T1._IDRRef = T18._Fld9136_RRRef)) AND (T18._Fld595 = ?)
  88. LEFT OUTER JOIN dbo._InfoRg11720 T19
  89. ON ((0x08 = T19._Fld12312_TYPE AND 0x000000E9 = T19._Fld12312_RTRef AND T1._IDRRef = T19._Fld12312_RRRef)) AND (T19._Fld595 = ?)
  90. LEFT OUTER JOIN (SELECT
  91. T21._Fld10332_TYPE AS Fld10332_TYPE,
  92. T21._Fld10332_RTRef AS Fld10332_RTRef,
  93. T21._Fld10332_RRRef AS Fld10332_RRRef,
  94. CAST(SUM(T21._Fld10335) AS NUMERIC(33, 8)) AS Fld10335Balance_
  95. FROM dbo._AccumRgT10337 T21
  96. WHERE (((T21._Fld595 = ?)) AND (EXISTS(SELECT
  97. 1
  98. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  99. LEFT OUTER JOIN dbo._Reference42 T22
  100. ON ((T21._Fld10330RRef = T22._IDRRef)) AND (T22._Fld595 = ?)
  101. WHERE EXISTS(SELECT
  102. 0x01 AS Q_001_F_000_
  103. FROM dbo._Reference98 T23
  104. INNER JOIN dbo._Reference21 T24
  105. ON (((T23._Fld1685 = ?) AND EXISTS(SELECT
  106. 0x01 AS Q_004_F_000_
  107. FROM dbo._InfoRg11709 T25
  108. WHERE ((T25._Fld595 = ?)) AND ((T25._Fld12065RRef = T23._IDRRef) AND (T25._Fld12066RRef = T24._IDRRef)))) AND T24._IDRRef IN
  109. (SELECT
  110. T26._Reference21_IDRRef AS Q_005_F_000RRef
  111. FROM dbo._Reference21_VT782 T26
  112. INNER JOIN dbo._InfoRg9937 T27
  113. ON ((T27._Fld9939_TYPE = 0x08 AND T27._Fld9939_RTRef = 0x00000095 AND T27._Fld9939_RRRef = ?) AND (T27._Fld9938_TYPE = T26._Fld784_TYPE AND T27._Fld9938_RTRef = T26._Fld784_RTRef AND T27._Fld9938_RRRef = T26._Fld784_RRRef))
  114. WHERE ((T26._Fld595 = ?)) AND (T27._Fld595 = ?)))
  115. WHERE ((T24._Fld595 = ?)) AND ((CASE WHEN T22._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  116. 0x01 AS Q_002_F_000_
  117. FROM dbo._InfoRg11710 T28
  118. WHERE ((T28._Fld595 = ?)) AND ((T28._Fld12072RRef = T24._IDRRef) AND (T28._Fld12073_TYPE = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END AND T28._Fld12073_RTRef = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T28._Fld12073_RRRef = T22._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  119. 0x01 AS Q_003_F_000_
  120. FROM dbo._InfoRg11715 T29
  121. WHERE ((T29._Fld595 = ?)) AND ((T29._Fld12199RRef = T24._IDRRef) AND T29._Fld12200_TYPE = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x08 END AND T29._Fld12200_RTRef = CASE WHEN T22._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T29._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND (T21._Period = ? AND (T21._Fld10335 <> ?) AND (T21._Fld10335 <> ?))
  122. GROUP BY T21._Fld10332_TYPE,
  123. T21._Fld10332_RTRef,
  124. T21._Fld10332_RRRef
  125. HAVING (CAST(SUM(T21._Fld10335) AS NUMERIC(33, 8))) <> 0.0) T20
  126. ON (0x08 = T20.Fld10332_TYPE AND 0x000000E9 = T20.Fld10332_RTRef AND T1._IDRRef = T20.Fld10332_RRRef)
  127. LEFT OUTER JOIN (SELECT
  128. T31._Fld14033RRef AS Fld14033RRef,
  129. CAST(SUM(CASE WHEN T31._RecordKind = 0.0 THEN T31._Fld14035 ELSE 0.0 END) AS NUMERIC(26, 8)) AS Fld14035Receipt_,
  130. CAST(SUM(CASE WHEN T31._RecordKind = 0.0 THEN 0.0 ELSE T31._Fld14035 END) AS NUMERIC(26, 8)) AS Fld14035Expense_
  131. FROM dbo._AccumRg14026 T31
  132. WHERE ((T31._Fld595 = ?)) AND (T31._Active = 0x01 AND ((T31._Fld14031RRef = ?)))
  133. GROUP BY T31._Fld14033RRef
  134. HAVING (CAST(SUM(CASE WHEN T31._RecordKind = 0.0 THEN T31._Fld14035 ELSE 0.0 END) AS NUMERIC(26, 8))) <> 0.0 OR (CAST(SUM(CASE WHEN T31._RecordKind = 0.0 THEN 0.0 ELSE T31._Fld14035 END) AS NUMERIC(26, 8))) <> 0.0) T30
  135. ON (T30.Fld14033RRef = T1._IDRRef)
  136. LEFT OUTER JOIN dbo._Reference51 T32
  137. ON (T1._Fld4635RRef = T32._IDRRef) AND (T32._Fld595 = ?)
  138. WHERE (((T1._Fld595 = ?)) AND (EXISTS(SELECT
  139. 1
  140. FROM (SELECT 1 AS SDBL_DUMMY) SDBL_DUAL
  141. LEFT OUTER JOIN dbo._Reference42 T33
  142. ON ((T1._Fld4625RRef = T33._IDRRef)) AND (T33._Fld595 = ?)
  143. WHERE EXISTS(SELECT
  144. 0x01 AS Q_001_F_000_
  145. FROM dbo._Reference98 T34
  146. INNER JOIN dbo._Reference21 T35
  147. ON (((T34._Fld1685 = ?) AND EXISTS(SELECT
  148. 0x01 AS Q_004_F_000_
  149. FROM dbo._InfoRg11709 T36
  150. WHERE ((T36._Fld595 = ?)) AND ((T36._Fld12065RRef = T34._IDRRef) AND (T36._Fld12066RRef = T35._IDRRef)))) AND T35._IDRRef IN
  151. (SELECT
  152. T37._Reference21_IDRRef AS Q_005_F_000RRef
  153. FROM dbo._Reference21_VT782 T37
  154. INNER JOIN dbo._InfoRg9937 T38
  155. ON ((T38._Fld9939_TYPE = 0x08 AND T38._Fld9939_RTRef = 0x00000095 AND T38._Fld9939_RRRef = ?) AND (T38._Fld9938_TYPE = T37._Fld784_TYPE AND T38._Fld9938_RTRef = T37._Fld784_RTRef AND T38._Fld9938_RRRef = T37._Fld784_RRRef))
  156. WHERE ((T37._Fld595 = ?)) AND (T38._Fld595 = ?)))
  157. WHERE ((T35._Fld595 = ?)) AND ((CASE WHEN T33._Fld12836RRef IS NULL THEN 0x01 ELSE CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x08 END END <> 0x01) AND (CASE WHEN EXISTS(SELECT
  158. 0x01 AS Q_002_F_000_
  159. FROM dbo._InfoRg11710 T39
  160. WHERE ((T39._Fld595 = ?)) AND ((T39._Fld12072RRef = T35._IDRRef) AND (T39._Fld12073_TYPE = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x08 END AND T39._Fld12073_RTRef = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND T39._Fld12073_RRRef = T33._Fld12836RRef))) THEN 0x01 ELSE 0x00 END = CASE WHEN EXISTS(SELECT
  161. 0x01 AS Q_003_F_000_
  162. FROM dbo._InfoRg11715 T40
  163. WHERE ((T40._Fld595 = ?)) AND ((T40._Fld12199RRef = T35._IDRRef) AND T40._Fld12200_TYPE = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x08 END AND T40._Fld12200_RTRef = CASE WHEN T33._Fld12836RRef IS NOT NULL THEN 0x0000001C END AND (T40._Fld12201 = 0x00))) THEN 0x01 ELSE 0x00 END)))))) AND ((T1._Fld4621RRef = ?) AND (T1._Date_Time >= ?) AND (T1._Date_Time <= ?) AND ((CASE WHEN ((T1._Fld4657RRef = ?) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T14.Fld10346Balance_ AS NUMERIC(33, 2)),?) > ?) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END END ELSE ? END < ?) OR ((CASE WHEN ((T1._Fld4657RRef = ?) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T14.Fld10346Balance_ AS NUMERIC(33, 2)),?) > ?) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?) = ?) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) > ?)) THEN ? WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),?) AS NUMERIC(33, 8)) / ?) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),?)) THEN ? ELSE ? END END ELSE ? END = ?) AND (T1._IDRRef < ?))))
  164. ORDER BY (CASE WHEN ((T1._Fld4657RRef = 0xAEB7F7D9237C245A447AADE98F164CDF) AND T1._Posted = 0x01) THEN CASE WHEN (ISNULL(CAST(T14.Fld10346Balance_ AS NUMERIC(33, 2)),0.0) > 0.0) THEN CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 4.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 6.0 ELSE 5.0 END ELSE CASE WHEN (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) = ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 0.0 WHEN ((ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0) = 0.0) AND (ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) > 0.0)) THEN 3.0 WHEN ((CAST(ISNULL(CAST(T2.Fld11330Turnover_ AS NUMERIC(27, 2)),0.0) AS NUMERIC(33, 8)) / 2.0) > ISNULL(CAST(T4.Fld10545Balance_ AS NUMERIC(27, 2)),0.0)) THEN 2.0 ELSE 1.0 END END ELSE 7.0 END) DESC, (T1._IDRRef) DESC
  165. ",Context=DynamicList.GetData : Document.InventoryExpense.Form.ListForm.Attribute.List
Add Comment
Please, Sign In to add comment