I have a query that selects by date. The result is that upper date being displayed is 1 day less than what I requested (in my example 2009-07-13 is the highest date even if I set @DateTo = 2009-07-14. If I now set @DateTo = 2009-07-15, the upper date being displayed is 2009-07-14 etc.set @Product = 'ULS'set @DateFrom = '2009-07-06'set @DateTo = '2009-07-14'select [load], date, branded, name, cast(gross as decimal(15,2)), cast(net as decimal(15,2))from [SFM-TP6000-1].TP6000.dbo.loadcomp as load1inner join [SFM-TP6000-1].TP6000.dbo.product as prod1 on prod1.product = load1.brandedwhere (@Product is null or branded = @Product) and (@DateFrom IS Null or date >= @DateFrom) and (@DateTo IS Null or date <= @DateTo)order by date