Dario Lopez-Kästen wrote:
Hello!
I need to display the results of an sql query and I need to compare the value of field A in the current item with the value of field A in the previous item, in order to display things correctly. <...>
Well, I don't know if it fits in your case, but did you think of dtml-ins marvellous grouping abilities? You just have to sort on an attribute and afterwards you can use first-<attribute> and last-<attribute> to determine, if the values of the attribute have changed: <dtml-in sql-search sort=office> <dtml-if first-office> <h1><dtml-var office></h1> <table> </dtml-if> <tr><th>Name</th><td>&dtml-name;</td></tr> <dtml-if last-office> </table> </dtml-if> </dtml-in> <dtml-unless there's no typo in it and you have defined all the variables>it may work</dtml-unless> ;-) happy zoping, Michael -- Michael Gutmann M.A. gutmann@uni-duesseldorf.de Multimediazentrum Heinrich-Heine-Universitaet Duesseldorf