macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: Searching on date ranges

Subject: Re: Searching on date ranges
From: Ian Skinner
Date: Tue, 21 Aug 2007 15:11:29 -0700
Newsgroups: macromedia.coldfusion.cfml_general_discussion


Or you could convert your form inputs into ODBC date time objects with the createODBCDateTime() function. This could potentially be more accurate. I am not sure how changing your dates to strings would effect your between functions would they be compared as dates or strings which could have different results.

But you may not be looking at this problem correctly. What are you actually looking for? A resource that is available for a date range. What if it is available for the beginning date and the end date, but not for some dates in between.

I.E. I want a room from July 1st, 2007 to July 15th. Room 115 is available from July 1st to the 5th, booked from the 6th to the 10th and again available after the 10th. Are you going to filter this use case out?

What I have seen before for this type of problem is that you need to break down the date range into individual dates and check a resource for all the dates.

Just be aware that this can be a fairly trick problem to solve.


<Prev in Thread] Current Thread [Next in Thread>