>Style Activity Actual Date >-------------------------------------------------- >JKT001 Costed 19/10/2005 >JKT001 Cut 20/10/2005 >JKT001 Made 21/10/2005 >JKT002 Costed 23/10/2005 >JKT002 Cut 24/10/2005 >JKT002 Made 26/10/2005 >>
>
><pre>
>Style Costed Cut Made
>------------------------------------------------------
>JKT001 19/10/2005 20/10/2005 21/10/2005
>JKT002 23/10/2005 24/10/2005 26/10/2005
>
>Public oForm oForm = Createobject('myForm') oForm.Show Define Class myForm As Form Height = 300 Width = 400 DataSession = 2 Add Object myGrid As Grid With Height = 300,Width=400 Procedure Init Set Nulldisplay To '' Local lcSQL TEXT to m.lcSQL noshow Select distinct a.Style, ; b.ActualDate as 'Costed', ; c.ActualDate as 'Cut', ; d.ActualDate as 'Made' ; from __mySource a ; left join __mySource b on a.Style == b.Style and b.Activity == 'Costed' ; left join __mySource c on a.Style == c.Style and c.Activity == 'Cut' ; left join __mySource d on a.Style == d.Style and d.Activity == 'Made' ; into cursor myGridSource && readwrite ENDTEXT m.lcSQL = Alltrim(Chrtran(m.lcSQL,Chr(9)+';'+Chr(13)+Chr(10),Space(2))) With This.myGrid .RecordSourceType = 4 .RecordSource = m.lcSQL Endwith Endproc EnddefineIf you enable editing remember you're doing it in a cursor.