String sql= "select amount,\n"+ "Temperature,\n"+ "Density\n"+
"from sheet\n"+ "where Code=? and product=? and and month(date)=? && year(date)=? ";
PreparedStatement stmt=DBConnectionDATABASE.prepareStatement(sql);
try {
stmt.setString(1, get.Code());
stmt.setString(2, get.Product());
stmt.setInt(3, get.month());
stmt.setInt(4, get.Year());
how can i find the last day of previous month with data .
use this query
this will return the maximum date between the date range
then
I am well aware that its not ethical to use aggregate functions without
group bybut it works in this case.