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

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -