I have a chart that is created with data from a query. But the problem is that sometimes the chart does not display the correct data.
I have a query that gets how many customer a therapist saw in a day, but the pronlem is that some of the therapist does not work every single day and when I pull out the query the graph just carry over the data from the previous data they had and display that instead of displaying 0.
here is the two queries that I'm using to create the chart.
CODE
<!--- GET A SINGLE THERAPIST DATA --->
<cfquery name="qryGetPatientSeen" datasource="sptc_billing">
SELECT Count(slipID) AS PatientSeen, apptDate
FROM billing_slips
WHERE apptDate >= #createODBCdate(Form.Fromdate)#
AND apptDate <= #createODBCdate(Form.Todate)#
AND therapist = '#Form.therapist#'
AND status = '1'
AND billStatus IN ('2','3')
GROUP BY apptDate
ORDER BY apptDate
</cfquery>
<!--- GET ALL THE DATA FROM ALL THERAPISTS --->
<cfquery name="qryGetPatientSeenAll" datasource="sptc_billing">
SELECT Count(slipID) AS PatientSeen, apptDate
FROM billing_slips
WHERE apptDate >= #createODBCdate(Form.Fromdate)#
AND apptDate <= #createODBCdate(Form.Todate)#
AND status = '1'
AND billStatus IN ('2','3')
GROUP BY apptDate
ORDER BY apptDate
</cfquery>
Here is the creation of the chart code
CODE
<cfchart format="flash" style="beige" chartwidth="700" labelformat="number">
<cfchartseries type="line" serieslabel="#Form.therapist#">
<cfoutput query="qryGetPatientSeen">
<cfchartdata item="#DateFormat(apptDate, 'mm/dd/yyyy')#" value="#PatientSeen#">
</cfoutput>
</cfchartseries>
<cfchartseries type="line" serieslabel="#Form.therapist#">
<cfoutput query="qryGetPatientSeenAll">
<cfchartdata item="#DateFormat(apptDate, 'mm/dd/yyyy')#" value="#PatientSeen#">
</cfoutput>
</cfchartseries>
</cfchart>
Attached is a screen shot witht he problem. Also you can see that the data is messing up because the dates get out of order.
So if I can just display 0 where the therapist has no data it would be great.