Use between
<cfquery name="qDateRange" datasource="ds">
SELECT * FROM dbo.PaP WHERE test_date BETWEEN #CreateODBCDate (startDate)# 
AND #CreateODBCdate (endDate)# 
ORDER BY #sort# ASC 
</cfquery> 


-----Original Message-----
From: Kennerly, Rick H CIV [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 10:17 AM
To: CF-Talk
Subject: Q_Range of dates


I think I've got a handle on queries for output forms where they are passed
a single month/year.  

However, what would a query for a range (such as JAN 2003 to MAR 2003 or JAN
2003 to DEC 2003) look like?  

Here's where I am.

<cfset startDate=CreateDate(Form.startYear, Form.startMonth, 1)>
<cfset endDate=DateAdd (Form.endYear, Form.endMonth,1)>
<cfquery name="qDateRange" datasource="ds">
SELECT * FROM dbo.PaP WHERE test_date >= #CreateODBCDate (startDate)# 
AND test_date < #CreateODBCdate (endDate)# ORDER BY #sort# ASC 
</cfquery> 

Rick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to