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.  [ 1 post ] 
Author Message
 Post subject: Performing HQL Query on basis of date of a timestamp field
PostPosted: Sun Oct 26, 2008 10:49 am 
Newbie

Joined: Sun Oct 26, 2008 9:47 am
Posts: 2
Location: India
Hello champs,

I have a very basic question for you guys. I have a timestamp field in postgress database which is mapped to timestamp in java. In general i query the databse with date and time checks so its work all fine.

Now i have a specific requirement where database has to be queried for equality only on date part of database field (which is a timestamp) and should not consider time. I found that hibernate provides day() month() year() function to retrieve date from a database field but i dont want to make three comparision with each database record for date equality.

can you guys please suggest a good way of comparing only date part of a timestamp field ?

e.g.
Transmissiondate is a timestamp field in table. e.g 26-10-2007T11:33:55Z

i want to retrieve database fields only on the basis of date part ignoring time. e.g. 26-10-2007

Kindly advise. Hope i am able to explain problem precisely.

_________________
Regards
SKS


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

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.