-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to compare two Date in Hibernate?
PostPosted: Thu Nov 18, 2004 2:49 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Hi everyone:

I want to know how to get the interval of two date. For example,I want to get the days between 2004-11-16 and 2004-11-23(the result will be 7). Does hibernate have this function to get the days between two days?

In SQL Server, we could use the function

Code:
USE pubs
SELECT DATEDIFF(day, pubdate, 'Nov 30 1995')
FROM titles


to get the interval of two days. But Hibernate can't use this method.

If anyone used this before please tell me. Thks!

_________________
You are not alone...


Top
 Profile  
 
 Post subject: :(
PostPosted: Thu Nov 18, 2004 6:32 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Any idea?

_________________
You are not alone...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 6:36 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You know, you could give others more time to answer. This is not a "free help within the hour" forum.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.