解决方案: |
通过自定义报表解决,在查询语句下加上oder by 语句
例如:SELECT Customer.cCusName AS 客户名称, Department.cDepName AS 部门名称,
Person.cPersonName AS 业务员, SaleBillVouch.dDate AS 日期,
SaleBillVouch.cSBVCode AS 发票号, Warehouse.cWhName AS 仓库名称,
Inventory.cInvName AS 存货名称, Inventory.cInvStd AS 规格型号,
SaleBillVouchs.iQuantity AS 数量, SaleBillVouchs.iNatTax AS 本币税额,
SaleBillVouchs.iNatMoney AS 本币无税金额,
SaleBillVouchs.iNatSum AS 本币价税合计,
SaleBillVouchs.iNatDisCount AS 本币折扣额, CONVERT(varchar(24),
SaleBillVouch.SBVID) AS sbvid, VouchType.cVouchName AS 单据类别
FROM SaleBillVouch LEFT OUTER JOIN
Person ON SaleBillVouch.cPersonCode = Person.cPersonCode LEFT OUTER JOIN
Department ON SaleBillVouch.cDepCode = Department.cDepCode LEFT OUTER JOIN
Customer ON SaleBillVouch.cCusCode = Customer.cCusCode INNER JOIN
SaleBillVouchs ON SaleBillVouch.SBVID = SaleBillVouchs.SBVID LEFT OUTER JOIN
Inventory ON SaleBillVouchs.cInvCode = Inventory.cInvCode LEFT OUTER JOIN
Warehouse ON SaleBillVouchs.cWhCode = Warehouse.cWhCode LEFT OUTER JOIN
VouchType ON SaleBillVouch.cVouchType = VouchType.cVouchType
WHERE (SaleBillVouch.dDate >=
(SELECT isnull(cValue, '1900-01-01')
FROM accinformation
WHERE cSysid = 'Sa' AND cName = 'dStartDate')) AND (SaleBillVouch.bFirst = 0)
AND (RTRIM(ISNULL(SaleBillVouch.cInvalider, '')) = '') --andSaleBillVouch.dDate='2006-06-06'
ORDER BY Department.cDepName, Inventory.cInvName |