Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT SUM(try_convert(numeric(38, 5), Rüsten_Ist)) AS Rüsten, 1 AS filtering
- FROM [Test].[dbo].[ZLA01_Lang_DETAIL]
- WHERE (ArbPl_Ist = 103100) AND (YEAR(BuchDatum) = 2019) AND (DATEPART(week, BuchDatum) = 21)
- UNION
- SELECT SUM(ISNULL(try_convert(numeric(38, 5), Arb__Plan), 0) + ISNULL(try_convert(numeric(38, 5), Masch__Ist), 0) + ISNULL(try_convert(numeric(38, 5), IstArb), 0)) AS B, 2 AS filtering
- FROM [Test].[dbo].[ZLA01_Lang_DETAIL]
- WHERE (ArbPl_Ist = 103100) AND (YEAR(BuchDatum) = 2019) AND (DATEPART(week, BuchDatum) = 21)
- UNION
- SELECT SUM(try_convert(numeric(38, 5), Restzeit_T)) AS Zukünftliche_Bearbeitungszeiten, 3 AS filtering
- FROM [Test].[dbo].[ZNEJO_DETAIL]
- WHERE (ArbPlatz = 103100) AND (YEAR(Endtermin) = 2019) AND (DATEPART(week, Endtermin) = 21)
- UNION
- SELECT SUM(try_convert(numeric(38, 5), Ausschuß)) AS C, 4 AS filtering
- FROM [Test].[dbo].[ZLA01_Lang_DETAIL]
- WHERE (ArbPl_Ist = 103100) AND (YEAR(BuchDatum) = 2019) AND (DATEPART(week,
- BuchDatum) = 21)
- UNION
- SELECT SUM(Angebot) AS Angebot, 5 AS filtering
- FROM [Test].[dbo].[CM01_DETAIL]
- WHERE (Woche = '21.2019') AND (Arbeitsplatz = '103100')
- UNION
- 'This is where I seperate the code.
- SELECT FORMAT((
- SELECT W21
- FROM [Test].[dbo].[Übersicht_Woche_RAP_103100]
- WHERE id = 2) /
- (SELECT W21
- FROM [Test].[dbo].[Übersicht_Woche_RAP_103100]
- WHERE id = 5),'P0') AS Calculation, 6 AS filtering
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement