-->
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.  [ 2 posts ] 
Author Message
 Post subject: Doubt with date
PostPosted: Fri Mar 18, 2005 2:36 am 
Newbie

Joined: Fri Feb 18, 2005 9:23 am
Posts: 10
Hi

I am using Sqlserver 2000 as my database with hibernate 2

I want to query a table for current date's data or between two dates ..
my field data type is DateTime

I just want to ignore time part for this particular report ..

Can any onle help me out how to use dates with queries ...

Thanks
Vijesh


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 2:41 am 
Newbie

Joined: Wed Mar 09, 2005 2:15 am
Posts: 3
hi vijesh,

i had he same problem. i tried the following code and it worked.
Code:
String start=null,end=null;
       Date d1=null,d2=null;

start=(String)((CompletedReportsForm)form).getStart();
      end=(String)((CompletedReportsForm)form).getEnd();
       d1 =Date.valueOf(start);
      d2 =Date.valueOf(end);

JbpmQuery jbpmquery;
            jbpmquery=new JbpmQuery( "select s from s in class org.jbpm.model.execution.impl.ProcessInstanceImpl where s.end >=:d1 and s.end <=:d2 ");
            jbpmquery.addParameter("d1",d1);
            jbpmquery.addParameter("d2",d2);



hope this helps you out.

regards ,
andrew.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.