SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE view load.NW_GW_VK_Journal_Accountings AS
select convert(varchar(10), Hauptbetrieb_ID)           AS Hauptbetrieb_ID,
       convert(varchar(50), Hauptbetrieb_Name)         AS Hauptbetrieb_Name,
       convert(varchar(10), Standort_ID)               AS Standort_ID,
       convert(varchar(50), Standort_Name)             AS Standort_Name,
       convert(varchar(150), Verkäufer)                AS Verkäufer,
       convert(varchar(100), Fabrikat)                 AS Fabrikat,
       convert(int, Fabrikat_Order_By)                 AS Fabrikat_Order_By,
       convert(varchar(50), Model)                     AS Model,
       convert(varchar(500), FZG)                      AS FZG,
       convert(varchar(150), Konto)                    AS Konto,
       convert(varchar(300), Modell_Beschreibung)      AS Modell_Beschreibung,
       convert(varchar(250), Kunde)                    AS Kunde,
       convert(varchar(20), Kundenart)                 AS Kundenart,
       convert(varchar(20), Fahrzeugart)               AS Fahrzeugart,
       convert(varchar(20), Fahrzeugtyp)               AS Fahrzeugtyp,
       convert(varchar(20), Fahrzeugtyp_1)             AS Fahrzeugtyp_1,
       convert(varchar(500), FZG_Detail)               AS FZG_Detail,
       convert(varchar(500), Buch_Text)                AS Buch_Text,
       convert(varchar(20), PLZ_1)                     AS PLZ_1,
       convert(varchar(20), PLZ_2)                     AS PLZ_2,
       convert(varchar(20), PLZ_3)                     AS PLZ_3,
       convert(varchar(20), PLZ_4)                     AS PLZ_4,
       convert(varchar(100), PLZ_Code_Deb)             AS PLZ_Code_Deb,
       convert(varchar(100), Name_Lieferant)           AS Name_Lieferant,
       convert(varchar(10), DB1___0)                   AS DB1___0,
       convert(varchar(100), Name_Einkäufer)           AS Name_Einkäufer,
       convert(decimal(28, 8), Menge)                  AS Menge,
       convert(decimal(28, 8), Erlös_FZG)              AS Erlös_FZG,
       convert(decimal(28, 8), Einsatz_FZG)            AS Einsatz_FZG,
       convert(decimal(28, 8), Boni)                   AS Boni,
       convert(decimal(28, 8), Nachlass)               AS Nachlass,
       convert(decimal(28, 8), Erlös_Prov_)            AS Erlös_Prov_,
       convert(decimal(28, 8), Erlös_Überf_)           AS Erlös_Überf_,
       convert(decimal(28, 8), VAK_Überf_)             AS VAK_Überf_,
       convert(decimal(28, 8), Erlös_Gar_)             AS Erlös_Gar_,
       convert(decimal(28, 8), VAK_Gar_)               AS VAK_Gar_,
       convert(decimal(28, 8), Erlös_Zul_)             AS Erlös_Zul_,
       convert(decimal(28, 8), VAK_Zul_)               AS VAK_Zul_,
       convert(decimal(28, 8), Erlös_Nachr_)           AS Erlös_Nachr_,
       convert(decimal(28, 8), VAK_Nachr_)             AS VAK_Nachr_,
       convert(decimal(28, 8), Erlös_Sonst_)           AS Erlös_Sonst_,
       convert(decimal(28, 8), VAK_Sonst_)             AS VAK_Sonst_,
       convert(decimal(28, 8), VAK_Inst_setz_)         AS VAK_Inst_setz_,
       convert(decimal(28, 8), Standtage)              AS Standtage,
       convert(decimal(28, 8), Instands__Werkstatt)    AS Instands__Werkstatt,
       convert(decimal(28, 8), Instands__Teile)        AS Instands__Teile,
       convert(decimal(28, 8), Instandsetzung_ges_)    AS Instandsetzung_ges_,
       convert(decimal(28, 8), Gesamterlöse_aus_imr)   AS Gesamterlöse_aus_imr,
       convert(decimal(28, 8), Einsatz_Gesamt_aus_imr) AS Einsatz_Gesamt_aus_imr,
       convert(datetime, Invoice_Date)                 AS Invoice_Date,
       convert(decimal(28, 8), Erlös_ges_)             AS Erlös_ges_,
       convert(decimal(28, 8), VAK_intern)             AS VAK_intern,
       convert(decimal(28, 8), VAK_ges_)               AS VAK_ges_,
       convert(varchar(100), PKW_NFZ)                  AS PKW_NFZ
from transform.NW_GW_VK_Journal_Accountings
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
