java - i want to sum a column of sql table where date is current date -


i want sum values of column date today's date , pass variable. wrote following code it's not working.

error: "column name sum(bill_total) not valid." considering "sum(bill_total)" column.

string sql = "select sum(bill_total) t_report date=?"; preparedstatement pst = con.preparestatement(sql); pst.setdate(1, date); resultset rs = pst.executequery(); string sum=rs.getstring(sql); 

can tell me whats wrong query. in advance

is me or error when you're fetching result?

string sql = "select sum(bill_total) bill_total t_report date=?"; preparedstatement pst = con.preparestatement(sql); pst.setdate(1, date); resultset rs = pst.executequery(); string sum=rs.getstring("bill_total"); 

Comments

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -