Solved

Error with dynamic variable

Posted on 2003-10-28
2
137 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
2 Comments
 
LVL 15

Accepted Solution

by:
danrosenthal earned 200 total points
Comment Utility
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
Comment Utility
Thank you
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now