I have maintained a table with start_date as "date" datatype and now I wanted to display the date in dd-mmm-yyyy format.
public static BusObjectIterator<com.timesheetmd.weeksView> weeksOfYear(int year) { String queryText = "SELECT `id`, `year`, CONCAT(CAST(`start_date` AS CHAR), ' to ', CAST(`end_date` AS CHAR)) AS 'week' FROM `weeks` WHERE `weeks`.`year` = :year AND end_date <= CURRENT_DATE ORDER BY start_date DESC"; QueryObject query = new QueryObject(queryText); query.addParameter("year", "weeks.year ", QueryObject.PARAM_INT,year);//NOPMD query.setResultClass(weeksView.class); return query.getObjects(); } As I want to return the result in the form of BusObjectIterator. Is it possible to change the format of the date in the query itself?