Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write to TO_CHAR and TO_DATE in HQL

 
Maya Pillai
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
How to write to TO_CHAR and TO_DATE in HQL (DB is MS SQL Server)

I would like to translate this query.

SELECT TO_CHAR(EMPJOINDATE,'MM/DD/YYYY HH:MI:SS') FROM EMP;

Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neither SQL Server nor HQL support TO_CHAR. What is it you are trying to achieve? If it is just formatting a date why not just do this using a DateFormat?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic