As explained may be wrongly i need to fill three different tables in an<BR>order to work in an applet<BR><BR>first one has to be receivers all distinct ones<BR>second products all disctint ones<BR>and the third one has to be a combination of the arrays receivers,products<BR>if does not exist in table assign value =0<BR><BR>i need speed and not using while do orecordset is there another way<BR>in other words i will need select distinct fill array receivers,products on<BR>each receiver product fill array kilos if does no exist kilos=0<BR>thanks in advance<BR>r.soler<BR><BR>my first question was<BR>i am using three diferent queries<BR><BR>first different products<BR><BR>SELECT DISTINCT [producto]<BR>FROM TOTALES;<BR><BR>second different receivers<BR><BR>first different receivers<BR><BR>SELECT DISTINCT [receptor]<BR>FROM TOTALES;<BR>i am using do loop to fill the arrays there is a better way???<BR>third<BR>here is where the question comes<BR><BR>i need to fill an array with the quantities of products if they are not in<BR>the database ,value has to be 0<BR>i need speed<BR>how i build the query , due to the fact that it needs to follow first two<BR>querys used to build a table for a java applet<BR><BR>it is possible to fill the array or i have to use three runs with the third<BR>one being recordset.find receptor=receivers(counter) and<BR>product=product(counter) if not exists the value=0<BR>all other queries had to be filling arrays<BR>it means sql select and then loop next really that is what i have thought<BR>due to not one answering my post in a lot of different forums maybe is to<BR>complicated or noone is interested<BR>my post was<BR><BR>i need for each different set of receptor,producto a values if exists<BR>thanks in advance<BR>r.soler<BR><BR><BR>by the way if idea on filling vbscript to java on my query will be<BR>appreciated.<BR><BR>for sql it works like this but if does not exist it does not fill<BR>the value and it has to be in same order<BR>receiver<BR>all products even if does not exist<BR>qty for receiver,product<BR>SELECT Product, Receptor, Sum(Qty) AS sumOfQty<BR>FROM somewhere<BR>GROUP BY Product, Receptor<BR>HAVING 0 &#060; Sum(Qty)<BR><BR>Maybe the aproach will be to fill first another table with all values<BR>receiver,product with 0 and then update the values how do i do it on sql<BR><BR><BR><BR><BR><BR><BR>