Zeit_Abwesenheit_neu.iqd 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,GC_LOCOSOFT
  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. c71 as c2,
  48. c70 as c3,
  49. c69 as c4,
  50. c68 as c5,
  51. c67 as c6,
  52. c66 as c7,
  53. c65 as c8,
  54. c64 as c9,
  55. c49 as c10,
  56. c63 as c11,
  57. c62 as c12,
  58. c61 as c13,
  59. c60 as c14,
  60. c59 as c15,
  61. c58 as c16,
  62. c57 as c17,
  63. c56 as c18,
  64. c55 as c19,
  65. c54 as c20,
  66. '1' 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. (cast_numberToString(cast_integer(T1."subsidiary"))) as c53,
  97. T4."description" as c54,
  98. T4."type" as c55,
  99. T3."is_annual_vacation" as c56,
  100. T3."description" as c57,
  101. T3."id" as c58,
  102. T2."booking_flag" as c59,
  103. T2."reason" as c60,
  104. T2."day_contingent" as c61,
  105. T2."is_payed" as c62,
  106. T2."type" as c63,
  107. T2."employee_number" as c64,
  108. T1."leave_date" as c65,
  109. T1."termination_date" as c66,
  110. T1."employment_date" as c67,
  111. T1."salesman_number" as c68,
  112. T1."mechanic_number" as c69,
  113. T1."initials" as c70,
  114. T1."name" as c71
  115. from "dbo"."employees" T1,
  116. "LOCOSOFT"."dbo"."employees_worktimes" T5,
  117. (("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")
  118. where (T1."employee_number" = T2."employee_number") and (T1."employee_number" = T5."employee_number")
  119. and ((((dayofweek(T2."date"))) = T5."dayofweek") and ((cdate(T2."date")) <= (@CURRENT_DATE)))
  120. ) D2
  121. ) D1
  122. where (c32 = c39)
  123. order by c1 asc
  124. END SQL
  125. COLUMN,0,Employee Number_Employees
  126. COLUMN,1,Name_Employees
  127. COLUMN,2,Initials_Employees
  128. COLUMN,3,Mechanic Number_Employees
  129. COLUMN,4,Salesman Number_Employees
  130. COLUMN,5,Employment Date_Employees
  131. COLUMN,6,Termination Date_Employees
  132. COLUMN,7,Leave Date_Employees
  133. COLUMN,8,Employee Number_Absence_Cal
  134. COLUMN,9,Date_Absence_Cal
  135. COLUMN,10,Type_Absence_Cal
  136. COLUMN,11,Is Payed_Absence_Cal
  137. COLUMN,12,Day Contingent_Absence_Cal
  138. COLUMN,13,Reason_Absence_Cal
  139. COLUMN,14,Booking Flag_Absence_Cal
  140. COLUMN,15,Id_Absence_Reas
  141. COLUMN,16,Description_Absence_Reas
  142. COLUMN,17,Is Annual Vacation_Absence_Reas
  143. COLUMN,18,Type_Absence_Types
  144. COLUMN,19,Description_Absence_Types
  145. COLUMN,20,Hauptbetrieb
  146. COLUMN,21,Standort
  147. COLUMN,22,Monteur
  148. COLUMN,23,Dummy_Arbeitszeit_Tag
  149. COLUMN,24,Abwesenheit
  150. COLUMN,25,Zeitkategorie
  151. COLUMN,26,Zeitkategorie2
  152. COLUMN,27,Ges. Std.
  153. COLUMN,28,Datum
  154. COLUMN,29,Order Number
  155. COLUMN,30,Wochentag_Datum
  156. COLUMN,31,Validity Date_Worktimes
  157. COLUMN,32,Dayofweek_Worktimes
  158. COLUMN,33,Work Duration_Worktimes
  159. COLUMN,34,Worktime Start_Worktimes
  160. COLUMN,35,Worktime End_Worktimes
  161. COLUMN,36,Max_Validity_Date_Worktimes
  162. COLUMN,37,Arbeitszeit_Tag