Yup, you're right about not necessarily getting midnight of course.
After looking at your expression with fresher eyes, I see that it
would work just fine. I was working with an assumption (and you know
what happens when we assume!), that the basedate did not include a
time element.

I can't remember the exact scenario, but it had to do with records
dropping out of the resultset because the addition of 23 hrs, 59 mins,
59 secs resulted in a timeperiod that didn't exist for certain dates
(March 11, 2007). When we used an addition of a day, minus a second,
we got the valid records, regardless of start-time.


> Adding a day and subtracting a second won't necessarily get you midnight
> tonight.  Also, given that daylight savings doesn't change at midnight, I
> can't see how/why this would be an issue.  I have used solutions like this
> in the past without issues with DST.
>
> >
> > This is one way of doing it. But watch out. Got bit by some old code
> > that used this approach on the switch to daylight savings time. It's
> > better to add a day, then subtract a second.
> >
> > > If you want to check until midnight today:
> > >
> > > SELECT * from request.events WHERE EventDate <
> > > #createDateTime(Year(Now()),Month(Now()),Day(Now()),11,59,59)#
> > >

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278994
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to