GuV_8_O21_2008.iqd 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,O21
  4. DATASOURCENAME,C:\GAPS\Portal\System\IQD\Belege\GuV_8_O21_2008.imr
  5. TITLE,GuV_8_O21_2008.imr
  6. BEGIN SQL
  7. select T1."ACCT_NR" as c1,
  8. T1."LEDGER_ACCTS_NAME" as c2,
  9. T1."LEDGER_ACCTS_NAME2" as c3,
  10. T1."HANDLER" as c4,
  11. T1."DEPT_SPLIT" as c5,
  12. T1."TYPE_ACCTT" as c6,
  13. T2."DEPARTMENT_TYPE_ID" as c7,
  14. T2."DESCRIPTION" as c8,
  15. T2."DEPARTMENT_GROUP" as c9,
  16. T3."AA_TRTYPE_ID" as c10,
  17. T3."DESCRIPTION" as c11,
  18. T3."OWN_DESCRIPTION" as c12,
  19. '1' as c13,
  20. (od_left(T2."DEPARTMENT_TYPE_ID",2)) as c14,
  21. (substring(T2."DEPARTMENT_TYPE_ID" from 3 for 1)) as c15,
  22. '' as c16,
  23. CASE WHEN ((((T1."ACCT_NR" LIKE '8%') and (not T1."ACCT_NR" BETWEEN '89050000' AND '89500001')) and (not T1."ACCT_NR" BETWEEN '8812000' AND '8812002')) or ((T1."ACCT_NR" LIKE '9%') and (T1."ACCT_NR" <> '99999999'))) THEN ((T4."DEBIT_AMOUNT" + T4."CREDIT_AMOUNT") * -1) ELSE (T4."DEBIT_AMOUNT" + T4."CREDIT_AMOUNT") END as c17,
  24. (database()) as c18,
  25. '' as c19,
  26. T4."ACCT_NO" as c20,
  27. T4."BOOKKEEP_DATE" as c21,
  28. T4."BOOKKEEP_PERIOD" as c22,
  29. T4."DOCUMENT_NO" as c23,
  30. T4."BOOK_NO" as c24,
  31. T4."STATUS" as c25,
  32. T4."DEBIT_AMOUNT" as c26,
  33. T4."CREDIT_AMOUNT" as c27,
  34. T4."DEBIT_QUANTITY" as c28,
  35. T4."CREDIT_QUANTITY" as c29,
  36. T4."AA_TRTYPE" as c30,
  37. T4."DEPARTMENT" as c31,
  38. T4."STOCK" as c32,
  39. T4."MAKE_FAMILY" as c33,
  40. T4."MAKE" as c34,
  41. T4."VEHICLE_TYPE" as c35,
  42. T4."MODEL_LINE" as c36,
  43. T4."FACTORY_MODEL" as c37,
  44. T4."WORKSHOP_MODEL" as c38,
  45. T4."PRODUCT_GROUP" as c39,
  46. T4."REPAIR_GROUP" as c40,
  47. T4."KIT_GROUP" as c41,
  48. T4."TIME_CODE" as c42,
  49. T4."INT_VOUCHER_NO" as c43,
  50. T4."BALANCING_MARK" as c44,
  51. T4."USED_VEH_DEST_CODE" as c45,
  52. T4."USE_OF_VEHICLE" as c46,
  53. T4."ACCT_NO_NEXT_CHART" as c47,
  54. T4."DEBIT_QUANTITY" + T4."CREDIT_QUANTITY" as c48,
  55. T5."REFERENCE_IDENT" as c49,
  56. T5."PROGRAM" as c50,
  57. T5."FUNCTION_CODE" as c51,
  58. T5."TRANSACT_CODE" as c52,
  59. T5."COMMENT" as c53
  60. from "deop01"."dbo"."ACCOUNT_INFO" T1,
  61. "deop01"."dbo"."ACCT_DOC_DATA_01" T5,
  62. (("deop01"."dbo"."ACCT_DOC_KEY_01" T4 left outer join "deop01"."dbo"."DEPARTMENT_TYPE" T2 on T4."DEPARTMENT" = T2."DEPARTMENT_TYPE_ID") left outer join "deop01"."dbo"."AA_TRTYPE" T3 on T4."AA_TRTYPE" = T3."AA_TRTYPE_ID")
  63. where (T4."ACCT_NO" = T1."ACCT_NR") and (T4."UNIQUE_IDENT" = T5."REFERENCE_IDENT")
  64. and (((T1."TYPE_ACCTT" IN ('2','1')) and (not (od_left(T1."ACCT_NR",1)) IN ('4'))) and (T4."BOOKKEEP_DATE" >= TIMESTAMP '2018-01-01 00:00:00.000'))
  65. END SQL
  66. COLUMN,0,Acct Nr
  67. COLUMN,1,Ledger Accts Name
  68. COLUMN,2,Ledger Accts Name2
  69. COLUMN,3,Handler
  70. COLUMN,4,Dept Split
  71. COLUMN,5,Type Acctt
  72. COLUMN,6,Department Type Id
  73. COLUMN,7,Description
  74. COLUMN,8,Department Group
  75. COLUMN,9,Aa Trtype Id
  76. COLUMN,10,Description
  77. COLUMN,11,Own Description
  78. COLUMN,12,Rechtseinheit
  79. COLUMN,13,Betrieb
  80. COLUMN,14,Marke
  81. COLUMN,15,Kostenstelle_ori
  82. COLUMN,16,Betrag
  83. COLUMN,17,Mandant
  84. COLUMN,18,Text
  85. COLUMN,19,Acct No
  86. COLUMN,20,Bookkeep Date
  87. COLUMN,21,Bookkeep Period
  88. COLUMN,22,Document No
  89. COLUMN,23,Book No
  90. COLUMN,24,Status
  91. COLUMN,25,Debit Amount
  92. COLUMN,26,Credit Amount
  93. COLUMN,27,Debit Quantity
  94. COLUMN,28,Credit Quantity
  95. COLUMN,29,Aa Trtype
  96. COLUMN,30,Department
  97. COLUMN,31,Stock
  98. COLUMN,32,Make Family
  99. COLUMN,33,Make
  100. COLUMN,34,Vehicle Type
  101. COLUMN,35,Model Line
  102. COLUMN,36,Factory Model
  103. COLUMN,37,Workshop Model
  104. COLUMN,38,Product Group
  105. COLUMN,39,Repair Group
  106. COLUMN,40,Kit Group
  107. COLUMN,41,Time Code
  108. COLUMN,42,Int Voucher No
  109. COLUMN,43,Balancing Mark
  110. COLUMN,44,Used Veh Dest Code
  111. COLUMN,45,Use Of Vehicle
  112. COLUMN,46,Acct No Next Chart
  113. COLUMN,47,Stk
  114. COLUMN,48,Reference Ident
  115. COLUMN,49,Program
  116. COLUMN,50,Function Code
  117. COLUMN,51,Transact Code
  118. COLUMN,52,Comment