feat(datamart): initial get active query migrated
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
export let getHeaders = `
|
||||
select AuftragsNummer as header,
|
||||
IdAuftragsAbruf as releaseNumber,
|
||||
AbrufLiefertermin as delDate
|
||||
FROM alplaprod_test1.dbo.V_TrackerAuftragsAbrufe (nolock) b
|
||||
|
||||
left join
|
||||
(
|
||||
select IdAdressen addressID,
|
||||
x.Bezeichnung as name,
|
||||
c.Bezeichnung as deliveryCondition,
|
||||
c.Kurzbezeichnung as Abbreviation
|
||||
from AlplaPROD_test1.dbo.t_Adressen (nolock) x
|
||||
left join
|
||||
AlplaPROD_test1.[dbo].[T_Lieferkonditionen] (nolock) c
|
||||
on x.IdLieferkondition = c.IdLieferkondition
|
||||
) x
|
||||
|
||||
on b.IdAdresse = x.addressID
|
||||
|
||||
WHERE AbrufStatus = 1 and
|
||||
AbrufLiefertermin between DATEADD(HOUR, -[from], GETDATE()) and DATEADD(HOUR, [to], GETDATE()) -- this number will be grabbed from the db with a default of 24hours
|
||||
and x.Abbreviation not in ('exw')
|
||||
and IdAuftragsAbruf not in ([exclude])
|
||||
`;
|
||||
Reference in New Issue
Block a user