It is a little wierd isnt it.  The code looked allright to me. 

We are using SQL Server 7.  I assume that getdate is an SQL function and
would not be effected by the fact that we are using CF 4.0.


-----Original Message-----
From: Michael Lugassy [mailto:[EMAIL PROTECTED]]
Sent: 21 May 2001 13:20
To: CF-Talk
Subject: Re: Querying by a date field.


That's weird, what DB are u using? that's working for me on SQL 7/2000
note that Date_Entered must be the colum name, right?

Anyhow, you can probarbly use this also:


<DATES ARE A MAJOR BAMMER>

<cfset ddifer = DateDiff("d", CreateDATE(date), now())>

<cfquery name="getdate" datasource="suppkb" dbtype="ODBC">
SELECT      *
FROM         Main_Table
WHERE       Date_Entered BETWEEN getdate(-#ddifer#) and getdate()

</cfquery>

</DATES ARE A MAJOR BAMMER>

That will insert into ddifer the number of days diffrentiation between NOW()
and what people
chose in your form and run a query based on : [today-#ddfier# days]  and
 today]

you will need to complete the CreateDate(date) function yourself...

But there probarbly other ways, better... sorry.

Thanks,

Michael Lugassy
IT/WEB Specialist
Interactive Music Ltd.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to