I am trying to make a report page. The user selects one of four possible
quarters (3 month intervals... 1/1/xxxx through 3/31/xxxx, 4/1/xxxx through
6/30/xxxx, etc) and the year. I am trying to query through the database based
between the dates and year that the user has entered.
<cfset yr = #FORM.yr#>
<cfset qrtr = #FORM.Qrtr#>
<cfif qrtr IS "Q1">
<cfset dateCreateMin = CreateDate(FORM.yr, 1, 1)>
<cfset dateCreateMax = CreateDate(FORM.yr, 3, 31)>
<cfset dateMin = DateFormat(dateCreateMin, 'mm/dd/yyyy')>
<cfset dateMax = DateFormat(dateCreateMax, 'mm/dd/yyyy')>
<CFSET dateMinNew = #CREATEODBCDATETIME("01/01/2007")#>
<CFSET dateMaxNew = #CREATEODBCDATETIME("03/31/2007")#>
</cfif>
<cfquery name="qGetCertificates" datasource="sonocme">
SELECT eMail, issueDate, testName, namePDF
FROM certificates
WHERE issueDate >= #dateMinNew# AND issueDate <= #dateMaxNew#
</cfquery>
This returns no data even though there are records that this satisfies. I have
also tried these other lines of code for the WHERE claus that also did not work.
WHERE issueDate between #dateMinNew# and #dateMaxNew#
WHERE issueDate>=#dateMinNew# AND issueDate<=#dateMaxNew#
Thanks in advance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2742
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15