Need to generate a weekly report in cf -- DateFormat(Now() - 7 days

Reply

Join Date: Jul 2005
Posts: 69
Reputation: bkendall is an unknown quantity at this point 
Solved Threads: 0
bkendall's Avatar
bkendall bkendall is offline Offline
Junior Poster in Training

Need to generate a weekly report in cf -- DateFormat(Now() - 7 days

 
0
  #1
Feb 9th, 2006
I have a cfmail script that sends a daily summary of orders. It basically grabs all of the orders from the db, uses DateFormat(Now() and then uses the query to generate the rport. The cf scheduler send the page daily.

Now I need to send a report on a weekly basis. I started by saving a new copy of the cfmail file. now I need to generate my date range. It needs to go from today and subtract 7 days. So we want to show all orders from the previous Friday to through Thursday night.

My query looks like this:
where a.OrderedDate = '#DateFormat(Now(), "yyyy-mm-dd")#'

can someone give me an example of what my date range would look like?

thanks!
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 69
Reputation: bkendall is an unknown quantity at this point 
Solved Threads: 0
bkendall's Avatar
bkendall bkendall is offline Offline
Junior Poster in Training

Re: Need to generate a weekly report in cf -- DateFormat(Now() - 7 days

 
0
  #2
Feb 9th, 2006
In case anyone else runs into this issue, here is the solution that worked for me:

<cfset startDate = Now() - 7>
<cfset endDate = Now()>
where a.OrderedDate >= #CreateODBCDate(startDate)# and a.OrderedDate <= #CreateODBCDate(endDate)#
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ColdFusion Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC