• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

timestamp--ejb QL in weblogic

 
smitham kumar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello every one..

How do I compare just Hours and minutes? I don't want the Seconds to be considered--(Ignore the seconds).


The query right now finds all the transaction with exact hr:mm:ss but I want to find that have exact hr:mm and seconds doesn't matter.

I want it find even those transaction that differ in seconds but have exact hr:mm

right now it is leaving those transactions that have exact hr:mm but differ in seconds

Thanks a lot in advance..
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually use Gregorian Calendar to do this. Gregorian calendar has a method in there ( I believe ) that says something like getField(). And then inside of that you pass in the field constant. something like myGregorianCal.getField(GregorianCalendar.MINUTES); something like that. Of course you could then do myGregorianCal.getField(GregorianCalendar.HOURS). To create the instance myGregorianCalendar, you might use the new GregorianCalendar(long) and pass in the milliseconds of the object. Typically that is the bridge between many of these time related objects. Most of them convert to down to milliseconds.

Hope that helps.

-Dale
 
smitham kumar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..thanks for replying..

is there any clause that I can make use of to compare only Hour and minute that I can make use of..as a 'between' or '<' and '>' in the ejb ql?

as I have to fetch all the transcations that has occured between 0 to 59 second of that minute?

thanks a ot again
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic