Skip to main content
February 12, 2007
Question

Chart Dates Format Problem

  • February 12, 2007
  • 1 reply
  • 296 views
My data set has monthly records with the date defined as a character with format '2007-02'. These values display correctly in graphs in my ColdFusion MX application when my local computer is acting as the host. However, when I move my application to our external host, the dates change to format {ts '2007-02-01 00:00:00'}. This change makes the graph hard to read. I'm at a loss as to where I should be looking to fix this problem. Can anyone help?

Thanks in advance.
This topic has been closed for replies.

1 reply

February 20, 2007
Hi,

In the chart query, choose Advanced Query Mode.

<!--- Set the locale of the hosting server --->
<cfset locale = SetLocale("English (UK)")>

<!--- Query to get the required data --->
<cfquery name="qData" datasource="yourDSN">
select theDateField, theValueField
from tblName
order by theDateField
</cfquery>


<!--- Create a query object containing the date field you want to display e.g. --->
<cfset myQry = QueryNew("mydate, myvalue","varchar,decimal")>

<!--- Loop through your recordset --->
<cfloop query="qData">

<!--- Populate myQry --->
<cfset numrow = QueryAddRow(myQry,1)>
<cfset tmp = QuerySetCell(myQry,"mydate",lsdateformat(qData.theDateField,"yyyy-mm"))>
<cfset tmp = QuerySetCell(myQry,"myvalue",qData.theValueField)>
</cfloop>

Then, in your Label Column, choose mydate, and in your Value Column, choose myvalue.

Hope this helps.

Regards,
Yogesh