feat(psi): psi querys added and av grab right now

This commit is contained in:
2025-08-10 18:11:57 -05:00
parent 52345bc94c
commit 8d63f7f6b0
8 changed files with 250 additions and 0 deletions

View 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`;