问题描述
我有一个要求,我必须从今天开始计算接下来的 5 个工作日,以计算预计的开放销售额。
我必须在我的 sql 查询中应用它作为过滤器。我在下面附上我的查询,其中包括周末。如果有人建议我找出除周末(周六和周日)之外的接下来 5 个工作日的解决方案,那将会很有帮助
select
s.salesid,l.itemid,l.SHIPPINGDATEREQUESTED as 'Ship Date',Case when not l.salesqty = 0 then (l.LINEAMOUNT/l.SALESQTY) * l.REMAINSALESPHYSICAL else 0 end as 'Projected Open Sales',from dbo.salestable s
inner join dbo.salesline l
on s.salesid = l.salesid and s.dataareaid = l.dataareaid and s.partition = l.partition
inner join dbo.inventtable i on l.itemid = i.itemid and l.DATAAREAID = i.DATAAREAID and l.partition = i.PARTITION
inner join dbo.ECORESTRACKINGDIMENSIONGROUPITEM ti on l.itemid = ti.itemid and l.DATAAREAID = ti.ITEMDATAAREAID and l.PARTITION = ti.PARTITION
inner join dbo.ECORESTRACKINGDIMENSIONGROUP g on ti.TRACKINGDIMENSIONGROUP = g.recid
where
s.SHIPPINGDATEREQUESTED > = getdate() and
s.SHIPPINGDATEREQUESTED <= getdate() + 5 and
and s.salestype in (0,3)
and l.salesstatus in (0,1)
and not l.salesqty = 0
order by s.SHIPPINGDATEREQUESTED asc
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)