COGNOS QUERY STRUCTURE,1,1 DATABASE,Locosoft_GC DATASOURCENAME,C:\GlobalCube\System\LOCOSOFT\IQD\zeit\Zeit_ben_Std_LG.imr TITLE,Zeit_ben_Std_LG.imr BEGIN SQL select distinct c1 as c1, c2 as c2, c3 as c3, c4 as c4, c5 as c5, c6 as c6, c7 as c7, c8 as c8, c9 as c9, c10 as c10, c11 as c11, c12 as c12, c13 as c13, c14 as c14, c15 as c15, c16 as c16, c17 as c17, c18 as c18, c19 as c19, c20 as c20, c21 as c21, c22 as c22, c23 as c23, c24 as c24, XMIN(c15 for c1,c8) as c25 from (select c31 as c1, '' as c2, '' as c3, '' as c4, c44 as c5, c43 as c6, 0 as c7, c30 as c8, 10 as c9, 'ben. Std.' as c10, '' as c11, c42 as c12, c41 as c13, c40 as c14, c39 as c15, c39 as c16, c38 as c17, c37 as c18, 0 as c19, c36 as c20, c35 as c21, c34 as c22, c33 as c23, c32 as c24, XMIN(c39 for c31,c30) as c26 from (select T2."mechanic_no" as c30, T1."order_number" as c31, T5."end_time" as c32, T5."start_time" as c33, T4."cancelation_date" as c34, T4."cancelation_number" as c35, T4."is_canceled" as c36, (T5."exact_duration_seconds" / 60) / 60 as c37, T5."exact_duration_seconds" / 60 as c38, T4."invoice_date" as c39, (rtrim((cast_numberToString(cast_integer(T3."employee_number"))))) || ' - ' || T3."name" as c40, T3."name" as c41, T3."employee_number" as c42, '0' || (rtrim((cast_numberToString(cast_integer(T3."subsidiary"))))) as c43, T2."order_number" as c44 from "LOCOSOFT"."dbo"."times" T5, ("dbo"."invoices" T4 left outer join (("dbo"."order_positions" T1 left outer join "dbo"."labours" T2 on T1."order_number" = T2."order_number") left outer join "dbo"."employees" T3 on T2."mechanic_no" = T3."employee_number") on (T2."invoice_number" = T4."invoice_number") and (T2."invoice_type" = T4."invoice_type")) where ((T2."order_number" = T5."order_number") and (T2."mechanic_no" = T5."employee_number")) and (((cast_float(T2."time_units"))) <> 0) ) D2 ) D1 where (c26 = c15) order by c1 asc,c8 asc,c23 asc END SQL COLUMN,0,Order Number COLUMN,1,Labour Type COLUMN,2,Code_Labour_Types COLUMN,3,Description_Labour_Types COLUMN,4,Order Number_Labours COLUMN,5,Subsidiary_Labours COLUMN,6,Invoice Type_Labours COLUMN,7,Mechanic No_Labours COLUMN,8,AW/Std. COLUMN,9,Zeitkategorie COLUMN,10,Zeitkategorie2 COLUMN,11,Employee Number_Employee COLUMN,12,Name_Employee COLUMN,13,Monteur COLUMN,14,Invoice Date_Invoices COLUMN,15,Datum COLUMN,16,Duration Minutes_Times COLUMN,17,ben. Std. COLUMN,18,Invoice Number COLUMN,19,Is Canceled COLUMN,20,Cancelation Number COLUMN,21,Cancelation Date COLUMN,22,Start Time COLUMN,23,End Time COLUMN,24,Min_Invoice_Date