Hello Friends
SimpleDateFormat frmt = new
SimpleDateFormat("yyyy-MM-dd");
searchCrit.add(Restrictions.le("postingDate"
,
java.sql.Date.valueOf(new String(frmt.format(dt)))));
searchCrit.add(Restrictions.ge("postingDate"
,
java.sql.Date.valueOf(new String(frmt.format(newDt)))));
I am using this query to compare betwwen two date values.In
data base i
have stored the date as java.sql.Date ftype.Now while
comparing it
takes the argument in this format:
dt as: 11 August 2006
Now in database it is stored as 2006-08-11.So its not able
to fetch the
desired results.So how to modify it..Please help..
Thanks In advance.
Sushovan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "java and hibernate" group.
To post to this group, send email to java-and-hibernate googlegroups.com
To unsubscribe from this group, send email to
java-and-hibernate-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/java-and-hibernate
-~----------~----~----~----~------~----~------~--~---
|