=SQLExec(nn,"SELECT COUNT(*) AS Cnt FROM products","MyResult1") ** Error handling here SQLSetProp(nn,"Asynchronous",.T.) xx=1 do while NOT USED("MyResult") && SQLEXEC() will return 0 till all records && fetched and returned to client. So, && when you want to fetch, just wait till alias created with && first FetchSize number of records (300 in this sample) =SQLExec(nn,"SELECT * FROM products","MyResult") INSERT INTO hits values(xx) &&here i need to put something like 23%,24%, etc. WAIT WINDOW NOWAIT TRANSFORM(RECCOUNT([Hints])/MyResult1.Cnt * 100)+[ %]