File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes How to write to TO_CHAR and TO_DATE in HQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to write to TO_CHAR and TO_DATE in HQL " Watch "How to write to TO_CHAR and TO_DATE in HQL " New topic
Author

How to write to TO_CHAR and TO_DATE in HQL

Maya Pillai
Ranch Hand

Joined: Jul 17, 2008
Posts: 60
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

Joined: Apr 14, 2004
Posts: 10336

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?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to write to TO_CHAR and TO_DATE in HQL