Question: I have two tables below

subcategorytbl

```
 sub_id    sub_title     sub_parent_id
   1        For rent           0
   2        Car                1
   3        Motorcycle         1 
   4        For Sale           0 
   5        Boat               4

```

itemtbl

```
  item_id    sub_id
    1          2
    2          2  
    3          3
    4          1
    5          2
    6          5

```

Car and Motorcycle are under For rent and Boat is under For Sale subcategory. Therefore,the result should be like this:

```
For Rent(5) 
- Car(3)
- Motorcycle(1)
For Sale(1) 
- Boat(1)

```

Below is my query:

```
  SELECT  count(*) as itemcount ,  sub_parent_id  from 
   subcategorytbl
  LEFT JOIN  itemtbl ON   subcategorytbl.sub_id=itemtbl.sub_id  
  GROUP BY   subcategorytbl.sub_id

```

Answer: 
To get the date, you can do

```
Date myDate = cell.getDateCellValue()

```

and then use SimpleDateFormat like your example :

```
if(DateUtil.isCellDateFormatted(cell)){
    Date myDate = cell.getDateCellValue();
    DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
    String result = formatter.format(myDate);
    System.out.println("Today : " + result);    
}

```
You should take date as a string in the file area. My reader like this.

```
switch (cell.getCellType()) {
                case Cell.CELL_TYPE_NUMERIC:
                    cellValue = String.valueOf((long) cell.getNumericCellValue());
                    break;
                case Cell.CELL_TYPE_STRING:
                    cellValue = cell.getStringCellValue();
                    break;
                }

```

Then you parse string with SimpleDateFormat.

My formatter;

```
public final static DateFormat BIRTHDAY_FORMATTER = new SimpleDateFormat("myPatterns");

```

and date;

```
Date date = BIRTHDAY_FORMATTER.parse(myCellValue);

```