Two Laptop Bag*
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 Android Security Essentials Live Lessons this week in the Android 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to write to TO_CHAR and TO_DATE in HQL
 
Similar Threads
Order by clause
Convert to timestamp yyyy-MM-dd hh:mm:ss a
java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric
String to Date Convertion in HQL
How to insert DateTime with HQL