Format date in hql query
- by user115520
hi all,
i want to format date to string in hql select, for example i have purchasing data with transaction date in it:
class Purchase {
private Date datePurchase
}
and i want to select date in a certain format, for example yyyyMMdd, can i do that in hql?
actually i can iterate through all purchase data returned by query, and start to format the date using SimpleDateFormat, but i don't want do that, i want to do it in hql, is it posible?
fyi, i just want to return the id and date string only, not all Purchase field.
thak you all for any help.