>Select ;
> Novellid.NW_Team as Team,;
> Ld_Product as Product,;
> Ld_Booked, ;
> Ld_Bdate, ;
> LD_EstCost as Est_Cost, ;
> Ld_CstOut as Act_Cost, ;
> R_LTL( 'L', ld_Quote, ld_load ) as LTL, ;
> LD_CstOut - LD_EstCost as Var_Cost ;
> From Loads, Novellid ;
> Where Not Empty(Loads.LD_booked) And ;
> Between( Loads.Ld_Bdate, xFrom, xto ) ;
> And ! InList( Loads.LD_Ctype, 'H','D' ) ;
> Into Table (app_udir + 'Booked')
Make sure that Loads has indexes on;
EMPTY(ld_BDate)
ld_BDate
DELETED()