This should return 1 years' worth of data...

<cfparam name="variables.myYear " default="#Year(Now())#"> 
<cfparam name="variables.StartDate " default="#createdate(variables.myYear,
1, 1)#">
<cfparam name="variables.EndDate " default="#createdate(variables.myYear,
12, 31)#">


<cfquery name="qryGetMyData" datasource="#Application.DSN#"
username="#Application.username#" password="#Application.password#">
    SELECT
        MyData
    FROM
        DataTable
    WHERE 
        MyDate BETWEEN '#variables.StartDate#' AND '#variables.EndDate#'
</cfquery>

- Nick



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:6083
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to