943,640 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 4502
  • ColdFusion RSS
Feb 9th, 2006
0

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

Expand Post »
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!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bkendall is offline Offline
69 posts
since Jul 2005
Feb 9th, 2006
0

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

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)#
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bkendall is offline Offline
69 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: Assistance
Next Thread in ColdFusion Forum Timeline: FrontPage Extensions and ColdFusion?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC