Thankyou Sergy,
Here is that syntax I have and I have added it to the Init event on the Grid.
PUBLIC neil
DIMENSION neil(5)
SET FIELDS global
SET EXACT ON
SELECT distinct t1.*, t2.key3, t2.key4 ;
from ("C:\Project\data\modacad.dbf") t1 ;
left outer join ("C:\Project\data\modacad.dbf") t2 ;
on t1.key3 = t2.key3 and t1.key4#t2.key4 ;
where t1.Key4 = 'SAMPLE' and t1.chk13=.T. ;
order by t1.key3 ;
into cursor crsmatch
SET FIELDS TO crsmatch.key1, crsmatch.key2, crsmatch.key3_a, crsmatch.key4_a, crsmatch.key4_b, ;
crsmatch.cosamp=IIF(crsmatch.key4_a='SAMPLE',1,0), crsmatch.cotech=IIF(crsmatch.key4_b='TECHNICAL',1,0), ;
crsmatch.chk13
SUM TO ARRAY neil
CREATE CURSOR result FROM ARRAY neil
with this
.RecordSourcetype = 0
.RecordSource = 'Select * from result'
.ColumnCount = 10
ENDWITH
Is this right?
Neil Lewis
IT R&D Manager
Velmore Ltd