Can you not do it with SQL? I would try:
<cfquery>
select id
from table
where #Now()# between datecolumn1 and datecolumn2
</cfquery>
if you get a record back (i.e. recordcount gt 0) then it matched?
-----Original Message-----
From: Todd Ashworth [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 08, 2000 1:21 PM
To: [EMAIL PROTECTED]
Subject: DateCompare()
I have 2 date fields in my database. I want to check to see if Now() falls
between the stored dates. Here is what I have:
<cfif #DateCompare(DateFormat(Now(), "yyyy-mm-dd"),
DateFormat(qryGetDates.date2, "yyyy-mm-dd"), "d")# LTE 0 AND
#DateCompare(DateFormat(Now(), "yyyy-mm-dd"), DateFormat(qryGetDates.date1,
"yyyy-mm-dd"), "d")# GTE 0>
date2 needs to be less than, or equal to Now() and date1 needs to be greater
than, or equal to Now(). I've tried it with and without DateFormat(). What
silly thing am I doing wrong?
.Todd
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.