Which DB? Mine's MySQL.
<cffunction name="currentSalesTotals" returntype="query" output="no"
access="public">
<cfset var currentSales="">
<cfquery name="currentSales" datasource="#Application.DSN#">
SELECT DISTINCTROW
Month(orders.OrderDate) AS
OrderMonth,
Left(Cast(MonthName(OrderDate) AS CHAR), 3) AS OrderMonthName,
SUM(orderdetails.Quantity*orderdetails.Price) AS TotalSales,
SUM(orderdetails.Quantity)
AS TotalUnits,
orders.Void
FROM orders
INNER JOIN orderdetails ON
orders.OrderID = orderdetails.OrderID
WHERE orders.Void = 0
AND orderdetails.Quantity > 0
AND (orders.OrderDate BETWEEN
'#year(now())-1#-#month(now())+7#-01' AND '#year(now())#-#month(now())#-31')
GROUP BY OrderMonth
ORDER BY orders.OrderDate
</cfquery>
<cfreturn currentSales>
</cffunction>
-----Original Message-----
From: Ray Champagne [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 05, 2005 2:18 PM
To: CF-Talk
Subject: RE: Cfchart newbie ?
Connie, I thought of that, but couldn't get it to work properly. Mind
sharing one of those queries?
That would save me some processing time!
At 05:13 PM 4/5/2005, you wrote:
>Or, apply the format in the query itself. I do something similar to get
>just the month from the date.
>
>
>-----Original Message-----
>From: Ray Champagne [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, April 05, 2005 1:20 PM
>To: CF-Talk
>Subject: Re: Cfchart newbie ?
>
>I got my answer - CFCHART sucks. :)
>
>It seems that there is no way to format x-axis data using either cfchart or
>cfchartseries. I had to be creative and loop through my query, changing
>the value of each row to be a nicely formatted date. Ugly solution, but it
>works. More info can be found in the comments section of this livedoc:
>
>http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-a11.htm
>
>Just FYI, for anyone that might read this in the archives!
>
>Ray
>
>At 03:25 PM 4/5/2005, you wrote:
> >I am making a simple line chart for the first time and I have run into an
> >easy stumbling block that I can't seem to Google out.
> >
> >The Y-Axis are a series of prices, while the X-Axis is a series of
> >dates. These are held in a DB. The problem that I am having is that the
> >date always outputs on the X-Axis label as the SQL date, ie; 2005-05-05
> >00:00:00.0. No matter what I try, I can't get it to diplay as a simple
> >date, like 05/05/2005.
> >
> >There has to be something I am missing here - I see a place to format the
> >data for the Y-Axis, why not the X-Axis? I know that I can flip the
chart,
> >but I don't want to do that.
> >
> >Ray
> >
> >=============================================
> >Ray Champagne - Senior Application Developer
> >CrystalVision Web Site Design and Internet Services
> >603.433.9559
> >www.crystalvision.org
> >=============================================
> >
> >The information contained in this transmission (including any attached
> >files) is CONFIDENTIAL and is intended only for the person(s) named
> >above. If you received this transmission in error, please delete it
> >from your system and notify us immediately. If you are not an intended
> >recipient, please note that any use or dissemination of the information
> >contained in this transmission (including any attached files) and the
> >copying, printing, or retransmission of that information is strictly
> >prohibited. You can notify us by return email or by phone at
603.433.9559.
> >Thank you.
> >
> >
> >
> >
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201620
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54