SQL Server date/time columns have precisions that vary depending on the exact type. In your first, the "0.999" is being rounded up.
The safest approach is to eschew between
and the time components, with something like:
SELECT [Order Date] , sum([Profit])
FROM [sample].[dbo].[superstore]
WHERE [Order Date] >= '2012-06-21' AND
[Order Date] < '2012-09-22'
GROUP BY [Order Date]
ORDER BY [Order Date];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…