|
|

楼主 |
发表于 2009/1/9 09:36:21
|
显示全部楼层
我只通过
DECLARE @itkey INT
DECLARE @dm INT
SELECT @itkey=ItemKey,@dm=DecimalPrecision FROM FS_Item WHERE ItemNumber='0001-0014'
PRINT @itkey
print @dm
SELECT RequiredDate,DemandSupplyType AS DS,LineStatus AS LStat,
ROUND(RequiredQuantity,@dm) AS ReqQty,ROUND(IssuedQuantity,@dm) AS IssQty,OrderType AS Type,
CASE DemandSupplyType WHEN 'D' THEN ParentDemandSupplyKey ELSE POHeaderKey END AS PK,
TopLevelDemandSupplyKey AS TK
FROM FS_DemandSupply
WHERE LineStatus<'5' AND (DemandItemKey=@itkey OR SupplyItemKey=@itkey)
Order By RequiredDate,DemandSupplyKey
查询出SDAL屏幕的信息,但我想通过自已写SQL实现
只写过标准成本的算法,与ForuthShift的CROL 完全滚加后比较, 在M/B/S类2万多个料号,都可达到基本一样的精确度,产生的误差主要在数据精度上,多层BOM累计的AtThisLevelMaterialCost, AtThisLevelLaborCost, RolledMaterialCost, RolledLaborCost 绝对值误差也在0.0001以下,与值的百分比在0.001% |
|