可能我没有说清,
select format(月,"00")&"-"&format(号,"000") as YY,年,月,日,号,摘要, 科目编码,总账科目,明细科目,round(借方金额,2) as 借方,round(贷方金额,2) as 贷方 from flb union all select format(月,"00")&"-9A" as YY, null, 月,null as 日,null as 号,'本月合计' as 摘要,left(科目编码,6),null as 总账科目, 明细科目,round(sum(借方金额),2),round(sum(贷方金额),2) from flb group by 月,left(科目编码,6), 明细科目 UNION ALL select format(月,"00")&"-9B" as YY,null as 年, 月,null as 日,null as 号,'本年累计' as 摘要,left(科目编码,6),null as 总账科目,明细科目,round(sum(借方金额),2),round(sum(贷方金额),2) from flb group by left(科目编码,6),明细科目,月;
在查旬中没有问题,但将此语句放在窗体的查询中就出错。
sql="以上语句"就出错 |