What kind of check are you talking about?
I think you might need to read the docs a bit more closely. From the docs for dateCompare():
Optional. String. Precision of the comparison.
- s Precise to the second (default)
- n Precise to the minute
- h Precise to the hour
- d Precise to the day
- m Precise to the month
- yyyy Precise to the year
Indeed, even by default its behaviour is not what you suggest it is.
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.
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