freelanceprogrammers.org Forum Index » Cold Fusion

Simple group by month question.......I hope.


View user's profile Post To page top
uncledansdesign Posted: Sat Aug 27, 2005 7:07 am


Joined: 18 Aug 2005

Posts: 2
Simple group by month question.......I hope.
This is my query for grouping sales by day over the last 30 days.  Any ideas how I can perform the same grouping except show the month totals for the past 12 months instead of the daily totals?
<CFSET todaysdate = Now()>
 
<cfquery name="daily" datasource="lilleys" maxrows="30">SELECT SUM(subtotal) as DailyTotal, jobdate FROM jobs where jobdate < <cfoutput>#todaysdate#</cfoutput> and status = `X` GROUP BY jobdate order by jobdate DESC;</cfquery>
 
I am using an access database.  Thanks!
 
Thanks.Dan
 
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help