Hi,

Is it possible to time a cfquery? that is to display the database results only 
after a certain time. So for example if I wanted my query to be displayed for a 
certain date(which I think I have, but might not be best practice), as well as 
a certain time, lets say 11:00 pm? 

I know I could create a scheduled task to run the code, but I was sondering 
there is a way to do it with the cfquery. Below is my code,

Thank you,
Johnny

<!--- CF Code--->
<cfset tipdate = #CreateODBCDate(now())#>

<cfquery name="rs_dailytip" datasource="#REQUEST.dataSource#">
    SELECT record_id, tipdate, dailytip, consumer_link,consumer_text, 
research_link, research_text
    FROM dailytips
    WHERE tipdate = #tipdate#
</cfquery>
<style type="text/css">
.red {
        color: #F00;
}
</style>



Today's Daily  Tip:<p>
                  <cfif rs_dailytip.recordcount>
                      <cfoutput><em>#DateFormat(tipdate, "mmmm d, 
yyyy")#</em></cfoutput><br />
                  <cfoutput>#rs_dailytip.dailytip#</cfoutput><p>
              Consumer Related Article:<br />
                <cfoutput><a href="#rs_dailytip.consumer_link#"> 
#rs_dailytip.consumer_text#</a></cfoutput><br /> 
              Research Related Article:<br />
               <cfoutput><a href="#rs_dailytip.research_link#"> 
#rs_dailytip.research_text#</a></cfoutput>
               <cfelse>
               <span class="red">No Daily tip today!</span>
                  </cfif> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:5158
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to