SQL.Add('select SaleInfo.ProductID,ProductInfo.ProductName,ProductInfo.PriceIn,Discount,QuantitySale,PriceSale,PriceTotal,DateSale');
SQL.Add(' from SaleInfo,ProductInfo');
SQL.Add(' where SaleInfo.ProductID=ProductInfo.ProductID and SaleInfo.ProductID in (select ProductID from SaleInfo) and SaleInfo.DateSale=#'+FormatDateTime('yyyy"-"mm"-"dd ',DateTimePicker1.Date)+'# and TimeSale=#'+FormatDateTime('hh":"mm":"ss',StrToTime(Trim(StringGrid1.Cells[8,Ri])))+'#');
SQL.Add(' from SaleInfo,ProductInfo');
SQL.Add(' where SaleInfo.ProductID=ProductInfo.ProductID and SaleInfo.ProductID in (select ProductID from SaleInfo) and SaleInfo.DateSale=#'+FormatDateTime('yyyy"-"mm"-"dd ',DateTimePicker1.Date)+'# and TimeSale=#'+FormatDateTime('hh":"mm":"ss',StrToTime(Trim(StringGrid1.Cells[8,Ri])))+'#');
报错时也是说is not a valid time。