Solved

Error with dynamic variable

Posted on 2003-10-28
2
142 Views
Last Modified: 2013-12-24
<CFOUTPUT query="q_ProjectNumbers">
  <CFSET 'TotalProject_#ProjectNumber#' = 0>
</CFOUTPUT>

<CFOUTPUT query="q_employeeNames"><CFSET TotalBillable = 0>
              <tr>
                <td>#q_employeeNames.employeeName#</td>
                 <CFLOOP list="#plist#" index="pid">
                       <CFQUERY name="q_ProjectsWorkedOn" datasource="MMIAppDB">
                        SELECT sum(BillableHours) AS Billable, ProjectNumber, EmployeeName
                        FROM Timesheet
                        WHERE EmployeeName = '#q_employeeNames.EmployeeName#' AND ProjectNumber = '#pid#' AND Date BETWEEN #createODBCdate(DateRange.Start)# AND #createODBCdate(DateRange.End)#
                        GROUP BY ProjectNumber, EmployeeName
                       </CFQUERY>
                       <td><CFIF q_projectsWorkedOn.billable is "">&nbsp;<CFELSE>#q_projectsWorkedOn.billable# <CFSET TotalBillable = (TotalBillable + q_projectsWorkedOn.billable)><CFSET 'TotalProject_#pid#' = 'TotalProject_#pid#' + q_projectsWorkedOn.billable></CFIF></td>
                 </CFLOOP>
              <td>#TotalBillable# <CFSET TotalTotal = (TotalTotal + TotalBillable)><td></tr>
            </CFOUTPUT>

Error:


The value "TotalProject_445" cannot be converted to a number  

The Error Occurred in C:\Inetpub\wwwroot\resourceadmin\viewtimesheet.cfm: line 68
 
66 :                         GROUP BY ProjectNumber, EmployeeName
67 :                        </CFQUERY>
68 :                        <td><CFIF q_projectsWorkedOn.billable is "">&nbsp;<CFELSE>#q_projectsWorkedOn.billable# <CFSET TotalBillable = (TotalBillable + q_projectsWorkedOn.billable)><CFSET 'TotalProject_#pid#' = 'TotalProject_#pid#' + q_projectsWorkedOn.billable></CFIF></td>
69 :                  </CFLOOP>
70 :               <td>#TotalBillable# <CFSET TotalTotal = (TotalTotal + TotalBillable)><td></tr>

 
0
Comment
Question by:Max_Davis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
danrosenthal earned 200 total points
ID: 9638205
looks like the error is with this line:
<CFSET 'TotalProject_#pid#' = 'TotalProject_#pid#' + q_projectsWorkedOn.billable>

change it to this:
<CFSET 'TotalProject_#pid#' = evaluate('TotalProject_'&pid) + q_projectsWorkedOn.billable>
0
 

Author Comment

by:Max_Davis
ID: 9638269
Thank you
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question