feat(psi): psi querys added and av grab right now
This commit is contained in:
27
server/services/sqlServer/querys/psiReport/deliveryData.ts
Normal file
27
server/services/sqlServer/querys/psiReport/deliveryData.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export const psiDeliveredData = `
|
||||
|
||||
use [test1_AlplaPROD2.0_Read]
|
||||
|
||||
declare @start_date nvarchar(30) = [startDate] --'2025-01-01'
|
||||
declare @end_date nvarchar(30) = [endDate] --'2025-08-09'
|
||||
|
||||
select
|
||||
ArticleHumanReadableId,
|
||||
ArticleAlias,
|
||||
cast(Quantity as int) Quantity,
|
||||
--cast(DeliveryDate as time) as deliveryTime,
|
||||
--cast(DeliveryDate as date) as originalDeliveryDate,
|
||||
case when cast(DeliveryDate as time) between '00:00' and '07:00'
|
||||
then DATEADD(DAY, -1, CONVERT(DATE, DeliveryDate))
|
||||
else cast(DeliveryDate as date)
|
||||
end as ShippingDate
|
||||
--,*
|
||||
from [order].[Release]
|
||||
|
||||
where case when cast(DeliveryDate as time) between '00:00' and '07:00'
|
||||
then DATEADD(DAY, -1, CONVERT(DATE, DeliveryDate))
|
||||
else cast(DeliveryDate as date)
|
||||
end between @start_date and @end_date
|
||||
and ArticleHumanReadableId in ([articles])
|
||||
|
||||
order by DeliveryDate`;
|
||||
Reference in New Issue
Block a user