SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [load].[Zeiterfassung]
AS
SELECT convert(varchar(20), [Client_DB]) as Client_DB
      ,convert(varchar(20), [No]) as No
      ,convert(varchar(20), [Document No]) as [Document No]
      ,convert(decimal(28,8),[Zeitdauer]) as Zeitdauer
      ,convert(varchar(20), [Stempel-Code]) as [Stempel-Code]
      ,convert(varchar(100), [Monteur]) as Monteur
      ,TRY_CONVERT(datetime, [Datum]) as Datum
      ,convert(varchar(20), [Department No]) as [Department No]
      ,convert(varchar(100), [Order Number]) as [Order Number]
      ,TRY_CONVERT(datetime, [Employment Date]) as [Employment Date]
      ,convert(varchar(20), [Hauptbetrieb_ID]) as [Hauptbetrieb_ID]
      ,convert(varchar(50), [Hauptbetrieb_Name]) as [Hauptbetrieb_Name]
      ,convert(varchar(20), [Standort_ID]) as [Standort_ID]
      ,convert(varchar(50), [Standort_Name]) as [Standort_Name]
      ,convert(varchar(50), [Activity_Codes_Group1]) as [Activity_Codes_Group1]
      ,convert(varchar(50), [Activity_Codes_Group2]) as [Activity_Codes_Group2]
      ,convert(varchar(50), [Activity_Desc]) as [Activity_Desc]
      ,convert(varchar(100), [First Name]) as [First Name]
      ,convert(varchar(100), [Last Name]) as [Last Name]
      ,convert(varchar(20), [Task Type Group]) as [Task Type Group]
      ,convert(varchar(20), [Function Code]) as [Function Code]
      ,convert(varchar(20), [Group No_ 1]) as [Group No_ 1]
      ,convert(varchar(20), [Group No_ 2]) as [Group No_ 2]
      ,convert(varchar(20), [Group No_ 3]) as [Group No_ 3]
      ,convert(varchar(50), [Monteur_Gruppe]) as [Monteur_Gruppe]
      ,convert(varchar(50), [Monteur_Gruppe_2]) as [Monteur_Gruppe_2]
      ,convert(decimal(28,8), [prod.]) as [prod.]
      ,convert(decimal(28,8), [unprod.]) as [unprod.]
      ,convert(decimal(28,8), [Abw.]) as [Abw.]
      ,convert(decimal(28,8), [Extern]) as [Extern]
      ,convert(decimal(28,8), [Intern]) as [Intern]
      ,convert(decimal(28,8), [fakt. Std.]) as [fakt. Std.]
      ,convert(decimal(28,8), [Umsatz Lohn]) as [Umsatz Lohn]
      ,convert(decimal(28,8), [Nachlass]) as [Nachlass]
      ,convert(decimal(28,8), [ben. Std.]) as [ben. Std.]
	  ,convert(decimal(28,8), [Sollzeit]) as [Sollzeit]
      ,convert(varchar(50), [Source Table]) as [Source Table]
  FROM [GC_ETL_ARI].[load].[Zeit_gesamt]
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
