I have a table with 15250326 records and I have problem with speed, I make a question and every body say USE A SQL-Select
this is very fast, but i try to do this and the sql-Select is very slow, but using a while is more fast
**when skip
Select sum(amount) as amount from Detail where ID_Customer=;
thisform.customerid.value into array Total_cust
thisform.customertotal.value=total_cust
thisform.refresh
this take a seven seconds in a Pentium 166 mmx with 32 Mb. ram
runing on a NT 4.0 lan with 100 workstations working in the same program.
the time ig good but if I need skip record by record the elapsed time is very slow, the I do the next:
**when Skip
Select Detail
**the detail table is order by ID_Customer
if seek(thisform.customerid.value)
Sum(amount) to thisform.customertotal.value while idcustomer=;
thisform.customerid.value
thisform.refresh
Select Customers
Endif
this proces take two seconds and is very fast!!!
Can somebody tellme why while is more quick than a SQL ?
thanks
Sory for my English!!!
Fernando España
SQL Server Specialist