Return-Path: Mailing-List: contact turbine-torque-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list turbine-torque-user@jakarta.apache.org Received: (qmail 10178 invoked by uid 98); 8 Jan 2003 08:51:10 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 10109 invoked from network); 8 Jan 2003 08:51:07 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 8 Jan 2003 08:51:07 -0000 Received: (qmail 81425 invoked by uid 500); 8 Jan 2003 08:49:38 -0000 Received: (qmail 81399 invoked from network); 8 Jan 2003 08:49:37 -0000 Received: from mailout02.sul.t-online.com (194.25.134.17) by daedalus.apache.org with SMTP; 8 Jan 2003 08:49:37 -0000 Received: from fwd01.sul.t-online.de by mailout02.sul.t-online.com with smtp id 18WBu7-0004Xg-0G; Wed, 08 Jan 2003 09:49:39 +0100 Received: from gabi (520063454473-0001@[80.141.124.128]) by fmrl01.sul.t-online.com with smtp id 18WBu0-0bp356C; Wed, 8 Jan 2003 09:49:32 +0100 Message-ID: <009b01c2b6f2$b9929f10$fe78a8c0@gabi> From: "Marc Guillemot" To: "Turbine Torque Users List" References: <1041956724.1523.22.camel@pjc.courcoux.biz> Subject: Re: Query on date field: pb with Criteria.addDate Date: Wed, 8 Jan 2003 09:48:32 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Sender: 520063454473-0001@t-dialin.net X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks Peter, it functions for me too with MySql on DATETIME columns. However because of the strange way needed to add the criteria I wonder if it functions accidentaly or if it is really portable. Marc. ----- Original Message ----- From: "Peter Courcoux" Newsgroups: gmane.comp.jakarta.turbine.torque.user Sent: Tuesday, January 07, 2003 5:25 PM Subject: Re: Query on date field: pb with Criteria.addDate > Marc, > > Try criteria.add(YourtablePeer.YOURCOLUMN, (Object) date, > Criteria.COMPARISON) > > This works for me using postgresql where date is a java.util.Date object > and the column is type TIMESTAMP. I'm not sure that I have tried other > column types or db's. > > I hope that this helps. > > Peter > > > > On Tue, 2003-01-07 at 15:50, Marc Guillemot wrote: > > Does someone use Criteria.addDate? > > I'm always stuck with this problem. > > > > Marc. > > > > ----- Original Message ----- > > From: "Marc Guillemot" > > To: > > Sent: Friday, December 20, 2002 6:31 PM > > Subject: Query on date field: pb with Criteria.addDate > > > > > > > Hi, > > > > > > I want to perform a doSelect with a criteria on a date field. > > > I've tryed > > > Criteria.addDate > > > and > > > Criteria.add with a GregorianCalendar as parameter > > > but in both cases I get an sql error (I use MySQL with the > > > org.gjt.mm.mysql.Driver driver) because the generated sql query just > > > contains the toString() representation of the GregorianCalendar: > > > > > > SELECT Tasks.ID, Tasks.WORKERID, Tasks.STARTDATE, Tasks.ENDDATE, > > > Tasks.PAUSE, Tasks.DESCRIPTION, Tasks.COMMENT, Tasks.STATUS, > > > Tasks.VALIDATORID, Tasks.VALIDATIONDATE FROM Tasks WHERE > > > > > Tasks.ENDDATE<=java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllF > > > > > ieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Berli > > > > > n",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=143,lastRu > > > > > le=java.util.SimpleTimeZone[id=Europe/Berlin,offset=3600000,dstSavings=36000 > > > > > 00,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDa > > > > > yOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,e > > > > > ndDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysIn > > > > > FirstWeek=4,ERA=1,YEAR=2002,MONTH=11,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_M > > > > > ONTH=1,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOU > > > R_OF_DAY=?,MINUTE=?,SECOND=?,MILLISECOND=?,ZONE_OFFSET=?,DST_OFFSET=?] > > > > > > Does Torque provide a way to perform a query with criteria on date fields? > > > > > > Marc. > > > > > > > > > > -- > > To unsubscribe, e-mail: > > For additional commands, e-mail: > -- > Peter Courcoux