This is one method of getting todays orders.

SELECT OrderID
FROM Orders
WHERE (DATEPART(d, OrderDate) = DATEPART(d, { fn NOW() })) AND
   (DATEPART(m, OrderDate) = DATEPART(m, { fn NOW() })) AND
   (DATEPART(yy, OrderDate) = DATEPART(yy, { fn NOW() }))

Jeff Craig
----- Original Message -----
From: "JB Mentzer" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, January 06, 2001 1:01 AM
Subject: how to match dates?


> Hi all
>
> I'm trying to write a query to find records matching today's date. What
> I have is:
>
> <CFSET timestamp = #DateFormat(now(),"yyyy-mm-dd")#>
>
>   <!--- find based on date  --->
>   <CFQUERY DATASOURCE="#SESSION.dsn#" NAME="gm_drawings_bydate">
>    SELECT
>     *
>
>    FROM
>     uprr_drawings dwg
>
>     WHERE
>     dwg.mod_date = #timestamp#
>   </CFQUERY>
>
>
> >From the table, the data looks like this:
>
> 1/5/2001 22:42:09,
> 11/13/2000 07:47:16
> and so on ...
>
>
> All ideas appreciated!
>
> * john *
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to