Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. SELECT SUM(try_convert(numeric(38, 5), Rüsten_Ist)) AS Rüsten, 1 AS filtering
  2. FROM [Test].[dbo].[ZLA01_Lang_DETAIL]
  3. WHERE (ArbPl_Ist = 103100) AND (YEAR(BuchDatum) = 2019) AND (DATEPART(week, BuchDatum) = 21)
  4. UNION
  5. 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
  6. FROM [Test].[dbo].[ZLA01_Lang_DETAIL]
  7. WHERE (ArbPl_Ist = 103100) AND (YEAR(BuchDatum) = 2019) AND (DATEPART(week, BuchDatum) = 21)
  8. UNION
  9. SELECT SUM(try_convert(numeric(38, 5), Restzeit_T)) AS Zukünftliche_Bearbeitungszeiten, 3 AS filtering
  10. FROM [Test].[dbo].[ZNEJO_DETAIL]
  11. WHERE (ArbPlatz = 103100) AND (YEAR(Endtermin) = 2019) AND (DATEPART(week, Endtermin) = 21)
  12. UNION
  13. SELECT SUM(try_convert(numeric(38, 5), Ausschuß)) AS C, 4 AS filtering
  14. FROM [Test].[dbo].[ZLA01_Lang_DETAIL]
  15. WHERE (ArbPl_Ist = 103100) AND (YEAR(BuchDatum) = 2019) AND (DATEPART(week,
  16. BuchDatum) = 21)
  17. UNION
  18. SELECT SUM(Angebot) AS Angebot, 5 AS filtering
  19. FROM [Test].[dbo].[CM01_DETAIL]
  20. WHERE (Woche = '21.2019') AND (Arbeitsplatz = '103100')
  21. UNION
  22. 'This is where I seperate the code.
  23. SELECT FORMAT((
  24. SELECT W21
  25. FROM [Test].[dbo].[Übersicht_Woche_RAP_103100]
  26. WHERE id = 2) /
  27. (SELECT W21
  28. FROM [Test].[dbo].[Übersicht_Woche_RAP_103100]
  29. WHERE id = 5),'P0') AS Calculation, 6 AS filtering
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement