select sheet_lot from osal_ord2 where sheet_qty-out_qty+return_qty>0 and convert(varchar(10),affirm_date,121) <= convert(varchar(10),dateadd(day,-1,getdate()),121) and audit_sw='1'