Copy link to clipboard
Copied
Hi,
Is there a cold fusion function that checks the complete date (mm/dd/yyyy) against another compelete date (mm/dd/yyyy)?
I have used the DateCompare but it only checks the month, day or year depending on the precision being used.
Thanks,
Mike
Copy link to clipboard
Copied
What kind of check are you talking about?
Copy link to clipboard
Copied
Check the complete date form a form against a complete date from a database table.
I would be check the date from the form against all the dates in the database table.
There would be two form dates, a start and end date. In the database there would be a start and end date.
The date check would ensure the entered start and end dates on the form do not overlap any of the start and end dates in the database.
I did notice the datecompare can be used without the precision option.
Mike
Copy link to clipboard
Copied
Looks like you are trying to use coldfusion code when sql code would be more appropriate.
If I am interpreting your post correctly, you want to do somethign like this:
select some fields
from some tables
where #coldfusion start date# not between database_start_date and database_end_date
and more stuff to complete your logic
Copy link to clipboard
Copied
I think you might need to read the docs a bit more closely. From the docs for dateCompare():
datePart
Optional. String. Precision of the comparison.
Indeed, even by default its behaviour is not what you suggest it is.
--
Adam