Wrox Programmer Forums
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 7th, 2006, 02:42 AM
Registered User
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Date in Hibernate

Hello Friends,

I'm using Hibernate/Mysql
I'm applying filter on weeks e.g I could see last weeks' records.
But when there are records of the same month it displays them correct but when there is a month difference (I want to see records of 03/11/2006 to 29/10/2006 then filter is not applying correctly)
not filtering.
The filter applied is given below:

myClassName.start_Date>=current_date-7 and myClassName.start_Date<=current_date

Please help

Old November 7th, 2006, 09:40 PM
Friend of Wrox
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts

Bearing in mind that I know very little about Hibernate, I'd have to ask a couple of questions...

1. What was the value of "current_date"?
2. What were the start_date's the filter returned?
3. You do realize that that the number of days from 29/10/2006 to 03/11/2006 (assuming dd/mm/yyyy format here) is only 6 days, right?
4. Does current_date also contain the current time?
5. Does start_date also contain the current time?

--Jeff Moden

Similar Threads
Thread Thread Starter Forum Replies Last Post
hibernate.LazyInitializationException briosam BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 1 July 2nd, 2008 05:18 AM
Crosstab with Hibernate samuels Hibernate 0 May 30th, 2008 07:37 AM
Hibernate help boddu.nageswar Hibernate 1 March 22nd, 2008 09:13 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.