java.sql.SQLException:[Microsoft] [ODBC Microsoft Access驱动程序]您试图执行不包含指定表达式“InvoiceDate”作为聚合函数一部分的查询。
try {
Connection con=Conn.getConnection();
Statement ps=con.createStatement();
ResultSet rs=ps.executeQuery("Select StoreName, InvoiceDate, sum(Rate*quantity), percent, sum(Tax*Quantity), sum(Amount) from Orders Order By InvoiceDate, InvoiceNo ASC ");
while(rs.next()){
v=new Vector();
v.add(rs.getString(1));
v.add(converToString(rs.getDate(2)));
v.add(rs.getDouble(3));
v.add(rs.getString(4));
v.add(rs.getDouble(5));
v.add(rs.getDouble(6));
mDateWise.addRow(v);
}
con.close();
}
catch (Exception ex) {
JOptionPane.showMessageDialog(c,ex.toString());
}
我只希望我的记录日明智,费率,税和税的总和;金额,但根据税收区分,即5%的税收条目在不同的行和& 13%的税收条目与总和将是一个差异。行。