On Wed, 14 Mar 2007 17:11:36 +0200, Nic Prioleau wrote: > Hi Kev, > > Thanks for your feedback however, I managed to get something like this: > > regNo,totalFuel,totalKM,month > B456TRF,1000,0,2 > B456TRF,150,0,3 > B456TRF,0,376,3 > B444AAA,50,0,3 > B444AAA,340,3000,3 > B444AAA,0,600,3 > > into a variable from my selects... Could you tell me how I can > achieve the same result as I was trying to get before as I have now > eliminated the other arrays I had. It was too messy and because they > did not have the same keys, it was difficult to get an accurate > result.
Basically the same thing, but it's actually easier in this case - you can take the variable and filter on the regNo (put an asterisk after the regno so there'll be a match): filter tData with "B444AAA*" And then loop through the resulting filtered lines, extract the items you're looking for an add them up: put 0 into tLitres put 0 into tKMs repeat for each line tLine in tData add (item 2 of tLine) to tLitres add (item 3 of tLine) to tKMs end repeat HTH, Ken Ray Sons of Thunder Software, Inc. Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ _______________________________________________ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution