Zeit_Abwesenheit_neu.iqd 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,Locosoft_GC
  4. DATASOURCENAME,C:\GlobalCube\System\LOCOSOFT\IQD\zeit\Zeit_Abwesenheit_neu.imr
  5. TITLE,Zeit_Abwesenheit_neu.imr
  6. BEGIN SQL
  7. select c1 as c1,
  8. c2 as c2,
  9. c3 as c3,
  10. c4 as c4,
  11. c5 as c5,
  12. c6 as c6,
  13. c7 as c7,
  14. c8 as c8,
  15. c9 as c9,
  16. c10 as c10,
  17. c11 as c11,
  18. c12 as c12,
  19. c13 as c13,
  20. c14 as c14,
  21. c15 as c15,
  22. c16 as c16,
  23. c17 as c17,
  24. c18 as c18,
  25. c19 as c19,
  26. c20 as c20,
  27. c21 as c21,
  28. c22 as c22,
  29. c23 as c23,
  30. c24 as c24,
  31. c25 as c25,
  32. c26 as c26,
  33. c27 as c27,
  34. c28 as c28,
  35. c29 as c29,
  36. c30 as c30,
  37. c31 as c31,
  38. c32 as c32,
  39. c33 as c33,
  40. c34 as c34,
  41. c35 as c35,
  42. c36 as c36,
  43. XMAX(c32 for c1) as c37,
  44. c38 as c38
  45. from
  46. (select c42 as c1,
  47. c72 as c2,
  48. c71 as c3,
  49. c70 as c4,
  50. c69 as c5,
  51. c68 as c6,
  52. c67 as c7,
  53. c66 as c8,
  54. c65 as c9,
  55. c49 as c10,
  56. c64 as c11,
  57. c63 as c12,
  58. c62 as c13,
  59. c61 as c14,
  60. c60 as c15,
  61. c59 as c16,
  62. c58 as c17,
  63. c57 as c18,
  64. c56 as c19,
  65. c55 as c20,
  66. c54 as c21,
  67. c53 as c22,
  68. c52 as c23,
  69. 8 as c24,
  70. c50 as c25,
  71. 'Abwesenheit' as c26,
  72. c51 as c27,
  73. c50 as c28,
  74. c49 as c29,
  75. '' as c30,
  76. c48 as c31,
  77. c47 as c32,
  78. c46 as c33,
  79. c43 as c34,
  80. c45 as c35,
  81. c44 as c36,
  82. c43 as c38,
  83. XMAX(c47 for c42) as c39
  84. from
  85. (select T1."employee_number" as c42,
  86. T5."work_duration" as c43,
  87. T5."worktime_end" as c44,
  88. T5."worktime_start" as c45,
  89. T5."dayofweek" as c46,
  90. T5."validity_date" as c47,
  91. (dayofweek(T2."date")) as c48,
  92. T2."date" as c49,
  93. (T2."day_contingent" * T5."work_duration") as c50,
  94. T3."id" || ' - ' || T3."description" as c51,
  95. (rtrim((cast_numberToString(cast_integer(T1."employee_number"))))) || ' - ' || T1."name" as c52,
  96. '0' || (rtrim((cast_numberToString(cast_integer(T1."subsidiary"))))) as c53,
  97. CASE WHEN (('0' || (rtrim((cast_numberToString(cast_integer(T1."subsidiary")))))) IN ('015')) THEN ('15') ELSE ('1') END as c54,
  98. T4."description" as c55,
  99. T4."type" as c56,
  100. T3."is_annual_vacation" as c57,
  101. T3."description" as c58,
  102. T3."id" as c59,
  103. T2."booking_flag" as c60,
  104. T2."reason" as c61,
  105. T2."day_contingent" as c62,
  106. T2."is_payed" as c63,
  107. T2."type" as c64,
  108. T2."employee_number" as c65,
  109. T1."leave_date" as c66,
  110. T1."termination_date" as c67,
  111. T1."employment_date" as c68,
  112. T1."salesman_number" as c69,
  113. T1."mechanic_number" as c70,
  114. T1."initials" as c71,
  115. T1."name" as c72
  116. from "dbo"."employees" T1,
  117. "LOCOSOFT"."dbo"."employees_worktimes" T5,
  118. (("dbo"."absence_calendar" T2 left outer join "dbo"."absence_reasons" T3 on T2."reason" = T3."id") left outer join "dbo"."absence_types" T4 on T2."type" = T4."type")
  119. where (T1."employee_number" = T2."employee_number") and (T1."employee_number" = T5."employee_number")
  120. and ((((dayofweek(T2."date"))) = T5."dayofweek") and ((cdate(T2."date")) <= (@CURRENT_DATE)))
  121. ) D2
  122. ) D1
  123. where (c32 = c39)
  124. order by c1 asc
  125. END SQL
  126. COLUMN,0,Employee Number_Employees
  127. COLUMN,1,Name_Employees
  128. COLUMN,2,Initials_Employees
  129. COLUMN,3,Mechanic Number_Employees
  130. COLUMN,4,Salesman Number_Employees
  131. COLUMN,5,Employment Date_Employees
  132. COLUMN,6,Termination Date_Employees
  133. COLUMN,7,Leave Date_Employees
  134. COLUMN,8,Employee Number_Absence_Cal
  135. COLUMN,9,Date_Absence_Cal
  136. COLUMN,10,Type_Absence_Cal
  137. COLUMN,11,Is Payed_Absence_Cal
  138. COLUMN,12,Day Contingent_Absence_Cal
  139. COLUMN,13,Reason_Absence_Cal
  140. COLUMN,14,Booking Flag_Absence_Cal
  141. COLUMN,15,Id_Absence_Reas
  142. COLUMN,16,Description_Absence_Reas
  143. COLUMN,17,Is Annual Vacation_Absence_Reas
  144. COLUMN,18,Type_Absence_Types
  145. COLUMN,19,Description_Absence_Types
  146. COLUMN,20,Hauptbetrieb
  147. COLUMN,21,Standort
  148. COLUMN,22,Monteur
  149. COLUMN,23,Dummy_Arbeitszeit_Tag
  150. COLUMN,24,Abwesenheit
  151. COLUMN,25,Zeitkategorie
  152. COLUMN,26,Zeitkategorie2
  153. COLUMN,27,Ges. Std.
  154. COLUMN,28,Datum
  155. COLUMN,29,Order Number
  156. COLUMN,30,Wochentag_Datum
  157. COLUMN,31,Validity Date_Worktimes
  158. COLUMN,32,Dayofweek_Worktimes
  159. COLUMN,33,Work Duration_Worktimes
  160. COLUMN,34,Worktime Start_Worktimes
  161. COLUMN,35,Worktime End_Worktimes
  162. COLUMN,36,Max_Validity_Date_Worktimes
  163. COLUMN,37,Arbeitszeit_Tag