I got date as String in format yyyy-MM-dd
and converted to
dd-mmm-yyyy
.
Now I need to add one day to my date.Because in my SQL when I am selecting data in between some dates like 27-aug-2017 to 29-aug-2017,it is showing values only for 27 and 28-aug-2017 and not for 29-aug-2017.So I need to add one day so I will get data for 29-aug-2017.
String dateto=request.getParameter("dateto");
Date date1=null;
try {
date1 = format1.parse(dateto);
temp1 = format2.format(date1);
System.out.println(temp1);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
My sql query
PreparedStatement psmt1=conn.prepareStatement("select * from deposit2_groupc_tja05 where Account_id =? and Transaction_Date between ? and ? order by Transaction_Date");