D
diamond~
Unregistered / Unconfirmed
GUEST, unregistred user!
日销售表(rxsb) xsrq为datetime字段
xsrq je
2002-01-01 12.3
2002-01-05 18.5
2002-01-01 456.2
如何写这条select 语句,统计当天总销售金额
需要达到如果dtp31.date,dtp32.date输入相同日期则统计出当天的销售合计数
asql:='insert into t_xs(xsdh,je) select xsdh,sum(xj) from s_spxs where xsrq between :d1 and :d2 group by xsdh';
adoquery1.sql.text:=asql;
adoquery1.parameters[0].value:=dtp31.date;
adoquery1.parameters[1].value:=dtp32.date;
adoquery1.execsql;
xsrq je
2002-01-01 12.3
2002-01-05 18.5
2002-01-01 456.2
如何写这条select 语句,统计当天总销售金额
需要达到如果dtp31.date,dtp32.date输入相同日期则统计出当天的销售合计数
asql:='insert into t_xs(xsdh,je) select xsdh,sum(xj) from s_spxs where xsrq between :d1 and :d2 group by xsdh';
adoquery1.sql.text:=asql;
adoquery1.parameters[0].value:=dtp31.date;
adoquery1.parameters[1].value:=dtp32.date;
adoquery1.execsql;