>Local lcLiftcond >Clear >Clear All >On Error llerror = .T. > >** Set deleted OFF to test the optimization >Set Deleted Off > >Close Databases All >Use 1001\psaudac In 0 Exclusive >Use 1001\psaudam In 0 Exclusive >Use 1001\customer In 0 Exclusive >Use 1001\pcode1 In 0 Exclusive > >Select psaudac >Select psaudam >Select customer >Select pcode1 > >lcLiftcond = '.T.' > > Do Case > Case Thisform.Optiongroup1.Value = 1 > Thisform._lcliftdate = ".T." > Case Thisform.Optiongroup1.Value = 2 > Thisform._lcliftdate = "empty(liftdate)" > Case Thisform.Optiongroup1.Value = 3 > Thisform._lcliftdate = "not empty(liftdate)" > Endcase > >lcLiftcond = Thisform._lcliftdate > >= Sys(3054, 1) > > Select 0 > Select ; > Str(Val(psaudam.saudano), 10) As dono, ; > godown.acname As locname, ; > party.acname As acname, ; > pcode1.wood As prodname, ; > mill.acname As millname, ; > psaudac.Lotno, ; > psaudac.Bags, ; > psaudac.Weight, ; > psaudac.liftdate, ; > psaudac.Rem1, ; > psaudac.Childid ; > From psaudam ; > Left Outer Join customer godown ; > On godown.accode = psaudam.loccode ; > Left Outer Join customer party ; > On party.accode = psaudam.accode ; > inner Join psaudac ; > On psaudac.Masterid = psaudam.Masterid ; > Left Outer Join pcode1 pcode1 ; > On pcode1.pcode = psaudac.pcode ; > Left Outer Join customer mill ; > On mill.accode = psaudac.millcode ; > Where psaudam.trnstatus = 'YO' ; > And &lcLiftcond ; > Order By 1 ; > Into Cursor junk1 Readwrite > >?Seconds() - m.lnSec > >= Sys(3054, 0) > >>