What he is trying to do threw me at first too, but what he wants is the records that 
expired in the last 24 hours. If he checked for records that expired on today's date 
and before the time that the query is run, to get records that expire today at 11:59PM 
the query would have to be run at 11:59PM. If he just wanted records that expire today 
at any time, this method would work. 

>Why are you testing the date against two different date/time values in the
>where clause?  Try it with just a single test, with < instead of <= and
>use the function CreateODBCDate() instead of CreateODBCDateTime().  This
>should find all records with an ExpiryDate before today.
>
>WHERE Coupons.ExpiryDate < #CreateODBCDate(Now())# AND
>      ...
>
>Jim
>
>
>-----Original Message-----
>From: Marco Gil <[EMAIL PROTECTED]>
>To: ColdFusion <[EMAIL PROTECTED]>
>Date: Friday, May 26, 2000 10:33 PM
>Subject: Listing Items That Expire Today? Help!
>
>
>>I'm trying to get it so that one of my web pages lists only items that
>are
>>going to expire today.  Here's my query:
>>
>><CFQUERY NAME="Expiring" DATASOURCE="#application.ds#">
>>
>>SELECT EntryDate, Items.RetailerID, Items.CategoryID, Items.ListingID,
>>CouponText, CouponURL, CouponDesc, Retailer, RetailerIMG, Category,
>Listing,
>>Items.ItemID
>>
>>FROM Items, Retailers, Categories, Listings, Coupons
>>WHERE Coupons.ExpiryDate <= #CreateODBCDateTime(Now())# AND
>>          Coupons.ExpiryDate >= #CreateODBCDateTime(Now())# - 1 AND
>>            Items.RetailerID = Retailers.RetailerID AND
>>            Items.CategoryID = Categories.CategoryID AND
>>            Items.ListingID = Listings.ListingID
>>         ORDER BY Retailer
>>
>></CFQUERY>
>>
>>However, it lists every single item.  Can anyone please help me with
>this?
>>Thanks so much!
>>
>>Marco
>
>------------------------------------------------------------------------------
>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.

Reply via email to