I tried to get a max value of a column with type date.
The codes are like:

Criteria crit = new Criteria();
crit.add(XXXXPeer.String, Object, Criteria.EQUAL);
crit.addSelectColumn("MAX(" + XXXXPeer.aDate + ")");
crit.add(XXXXPeer.String, Object, Criteria.EQUAL);
List result = XXXXPeer.doSelect(crit);

But it is not working.
The exception says:
Error: org.apache.torque.TorqueException: Illegal conversion:
com.workingdogs.village.DataSetException: Invalid type for Integer

Does it mean it is type related?
Another question, what is the key difference between Criteria.add and
Criteria.and?

Thanks in advance.

Jill



-----Original Message-----
From: Thomas Fischer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 29, 2005 2:01 AM
To: Apache Torque Users List
Subject: RE: select max(column)





Look in the wiki. Ther it is described how to select count(*) from a
table.
The same procedure can be used to find out "max(" + SomePeer.COLUMN_NAME
+")";

http://wiki.apache.org/db-torque/FrequentlyAskedQuestions#head-9317e897d
07dbd597993796d47bfbbe2443bc5bf

    Thomas


"Kintzel Levente" <[EMAIL PROTECTED]> schrieb am 24.03.2005
14:19:30:

>
>    Hi!
>
> I want to determine the max value of a column with Torque. How can I
do
> this? Thanx!
>
>          Levi Kintzel
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to