SELECT PADL(VAL(t1.certno),10,'0') AS certno,t1.stockplanid,; t2.planid AS planid FROM certlog t1 ; LEFT JOIN Values t2 ; ON ALLTRIM(t1.stockplanid) = ALLTRIM(t2.id) ; INTO CURSOR curCert1 ORDER BY planid,certnowhere certno is the field in question. This is a sample of the results:
Certno StockPlanid Planid 0000010.00 1 1 0000100.00 1 1 0001000.00 5 1 0001002.00 5 1 0001003.00 5 1 0000101.00 1 1 0000102.00 1 1 0001021.00 5 1What I want is:
Certno StockPlanid Planid 0000010.00 1 1 0000100.00 1 1 0000101.00 1 1 0000102.00 1 1 0001000.00 5 1 0001002.00 5 1 0001003.00 5 1 0001021.00 5 1Hope this clarifies things abit.