DATE(widget_made) = :user_date
Which does what I want and avoids the problem you brought up. But sometimes I have some more complicated logic that falls down if I try to compare datewise. So I manually create the DateTime ranges, and use 23:59:59 as the end of the range. So something like widget_made BETWEEN :user_date '00:00:00' AND :user_date '23:59:59'
Anything that came off the line at 23:59:59.3421 will be excluded. Fortunately for me, I don't think that has ever actually happened. But now I know to be on the lookout, and use proper date-handling tools to ensure correctness.No comments yet.