hi Brett,

First set your today's date as fromdate and toDate, since
you need to check any records that fall between 00:00:00
hrs to 23:59:59 (I hope that you know what I mean). The
following piece of code will work both for the records
with dates w/o time as well as dates with time 

<!--- First you are defining the start and end of the
day by defining start date with 00:00:00 hrs and end
date with 23:59:59 --->

<cfset Variables.FromDate = CreateDateTime(Year(Now()),
Month(Now()), Day(Now()), 0, 0, 0)>
<cfset Variables.ToDate = CreateDateTime(Year(Now()),
Month(Now()), Day(Now()), 23, 59, 59)>

<cfquery name="dateQuery" datasource="#Application.DSN#">

SELECT Id, Email, FirstName, Date_Purchased, Date_Remind
FROM customers WHERE
        Date_Remind BETWEEN #Variables.FromDate# AND #Variables.ToDate#

</cfquery>

<cfoutput query="dateQuery">
#dateQuery.Id# / #dateQuery.Email# / #dateQuery.FirstName#
/ #dateQuery.Date_Purchased# / #dateQuery.Date_Remind#
<br>
</cfoutput>


HTH

Subramanian Chakrapani

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On

Behalf Of Brett Smith
Sent: Saturday, July 21, 2001 8:46 PM
To: [EMAIL PROTECTED]
Subject: 

Below is a query I need some help on.  All I am trying
to do is select the
customers from the database that have a remind date of
today.  I am having
problems with my WHERE statement.  The query is not returing
any records but
there are records that have the Date_Remind of today.
 Can anyone help?

The Date_Remind field is a short date in an Access database.


<CFQUERY NAME="GetCustomers" DATASOURCE="#DATASOURCE#">

SELECT ID, EMAIL, FIRSTNAME, DATE_PURCHASED, DATE_REMIND

FROM CUSTOMERS
WHERE (('DateFormat(Date_Remind, "M/DD/YYYY")') = ('DateFormat(Now(),

"M/DD/YYYY")'))
</CFQUERY>


<CFOUTPUT QUERY="GetCustomers">
Date Remind: #DateFormat(Date_Remind, "M/DD/YYYY")#<BR>

Now: #DateFormat(Now(), "M/DD/YYYY")#<BR>
Email: #Email#<BR>
<P></CFOUTPUT>



_________________________________________
Free web based e-mail with Pop access at http://www.newmail.net

-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to