此主题相关图片如下:qq截图20130223155414.png
如上图本期入库金额小数位超长,我只要两位,怎么设呢
注:这是统计查询表,sql代码为:
'仓库汇总表
s1 = "SELECT '0' AS 序号, 库名, (SELECT COUNT(*) FROM (SELECT DISTINCT 库名,货品编码 FROM CKKC,仓库信息 WHERE 仓库 = 库名) WHERE 库名 = M.库名) AS 商品种类, (SELECT COUNT(*) FROM CYMX WHERE 方向='入库' AND 仓库 = M.库名 @#$) AS 本期入库_笔数, (SELECT SUM(金额) FROM CYMX WHERE 方向='入库' AND 仓库 = M.库名 @#$) AS 本期入库_金额, (SELECT COUNT(*) FROM CYMX WHERE 方向='出库' AND 仓库 = M.库名 @#$) AS 本期出库_笔数, (SELECT Round(SUM(金额),2) FROM CYMX WHERE 方向='出库' AND 仓库 = M.库名 @#$) AS 本期出库_金额, (SELECT COUNT(*) FROM CYMX WHERE 仓库 = M.库名 AND (类型='调拨入库' OR 类型='调拨出库') @#$) AS 本期调拨_笔数, (SELECT COUNT(*) FROM CYMX WHERE 仓库 = M.库名 AND 类型='调拨入库' @#$) AS 本期调拨_调入笔数, (SELECT COUNT(*) FROM CYMX WHERE 仓库 = M.库名 AND 类型='调拨出库' @#$) AS 本期调拨_调出笔数, Round((SELECT SUM(金额) FROM CYMX WHERE 仓库 = M.库名 AND (类型='调拨入库' OR 类型='调拨出库') @#$),2) AS 本期调拨_金额, (SELECT COUNT(*) FROM CYMX WHERE 仓库 = M.库名 AND (类型='盘盈' OR 类型='盘亏') @#$) AS 本期盘点_笔数, (SELECT COUNT(*) FROM CYMX WHERE 仓库 = M.库名 AND 类型='盘盈' @#$) AS 本期盘点_盘盈笔数, (SELECT COUNT(*) FROM CYMX WHERE 仓库 = M.库名 AND 类型='盘亏' @#$) AS 本期盘点_盘亏笔数, Round((SELECT SUM(金额) FROM CYMX WHERE 仓库 = M.库名 AND (类型='盘盈' OR 类型='盘亏') @#$),2) AS 本期盘点_金额, '' AS 备注 FROM 仓库信息 AS M"