Bob,
Probably the fastest you'll ever get is this (supposing you only need 50 records or so)
select Field1, field2, recno() as recn ;
from work_que ;
into cursor tmp ;
where .f.
select tmp
=CreateCursor('sw_curs1')
use in tmp
select work_que
set order to instdate
go top
scan next 50 for condition1 and condition and condition3
insert into sw_curs1(Field1, field2, recn) ;
values(work_que.Field1, work_que.Field2, recno('work_que') )
endscan
procedure CreateCursor(Cursor)
local x[1], i, j, s
=afields(x)
for i = 1 to alen(x,1)
for j = 6 to alen(x,2)
x[i,j] = ''
endfor
endfor
s = select(0)
if( used(Cursor) )
use in (Cursor)
endif
select 0
create cursor (Cursor) from array x
select (s)
endproc
>>
>>>Is there anyting that can be done to have the server only deliver the resultant?
>>
>>Can you show us the SELECT statement and list all the indexes you have created on the tables involved?
>>
>>Christof
>
>Thanks Cristof..
>
>I did send the info on the SQL's and Tags as a reply on my original thread. I also tried splitting the SQL into 3-statements along with adding a new tag ALLT(site)+ALLT(remoteunit)+ALLT(wh_stat).. I am now down to 1.3 megs from a revised 1.8 megs. give or take some k's. I am NOT yet convinced that using 3-sqls is the answer as my test network has a lot of bandwidth and no traffic today. It also appears that the execution of the browse is a little slower using this approach and my fears are that eventhough the net traffic is less, I am only going out once and not 3 times which may not be better on a busy network. I am still searching for the answer as to WHY and WHAT is being sent to the client amounting to this excess net traffic. Anyway here are the SQL's which will only work in 7.0..
>
>By the way I recently came accross the _Tally failing to update when a record set is 0... It retained a value from a prior SQL... Any thoughts..
>
>ndispvalu='TOP 50 '
>cccsite='6'
>
>selethis=[SELE site,instdate,idlc,len,rcntelno,wh_user,wh_stat,wh_comp,action,RECN() AS recn,rsu_no,lastassgn ]+;
> [FROM FORCE work_que WHERE ALLTRIM(site)+ALLT(remoteunit)+ALLTRIM(wh_stat)=cccsite+"MIP " INTO CURS sw_curs1 ORDE BY 2 READWRITE]
>&selethis
>selethis=[SELE site,instdate,idlc,len,rcntelno,wh_user,wh_stat,wh_comp,action,RECN() AS recn,rsu_no,lastassgn ]+;
> [FROM FORCE work_que WHERE ALLTRIM(site)+ALLT(remoteunit)+ALLTRIM(wh_stat)=cccsite+"MIP TC" INTO CURS sw_curs2 ORDE BY 2]
>&selethis
>IF _TALLY>0
>* IF RECCOUNT('sw_curs2')>0
> SELECT sw_curs1
> APPEND FROM sw_curs2
>ENDI
>selethis=[SELE site,instdate,idlc,len,rcntelno,wh_user,wh_stat,wh_comp,action,RECN() AS recn,rsu_no,lastassgn ]+;
> [FROM FORCE work_que WHERE ALLTRIM(site)+ALLT(remoteunit)+ALLTRIM(wh_stat)=cccsite+"MIP R" INTO CURS sw_curs3 ORDE BY 2]
>&selethis
>* IF RECCOUNT('sw_curs3')>0
>IF _TALLY>0
> SELECT sw_curs1
> APPEND FROM sw_curs3
>ENDI
>selefrom=[SELECT ]+ndispvalu+[ * FROM sw_curs1 INTO CURS sw_curs ORDE BY 2]
>&selefrom
Gregory