>MySql can't have a semicolon (;) in the script. Try this. > >
>lnResult=SQLEXEC(mConn,"Select T1.* From Inv T1 Inner Join (Select Itm_Code, MAX(Date) as LastDate From Inv Group by Itm_Code) T2 " ;
>+" on T1.Itm_Code = T2.Itm_Code and T1.Date = T2.LastDate")
>