Hello,

I am trying to build an array and cannot get around
this error message:
               The element at position 2 in dimension
1 of object "aggdata.AggHours" cannot be found. The
object has elements in positions 1 through 1. Please,
modify the index expression.


This is my code for populating the array:

 <cfset Suparray = Arraynew(2)>

       <cfloop query="QRYdetail">

        <cfset Suparray[CurrentRow][1] =  
               QRYdetail.efirst[CurrentRow]>
        <cfset Suparray[CurrentRow][2] = 
               QRYdetail.vSSN[CurrentRow]>
        <cfset Suparray[CurrentRow][3] = 
               QRYdetail.TrainDate[Currentrow]>
        <cfset Suparray[CurrentRow][4] = 
               QRYdetail.Site[CurrentRow]>
        <cfset NADAPSuparray[CurrentRow][5] = 
               QRYdetail.units[CurrentRow]>
        <cfset Suparray[CurrentRow][6] = 
               QRYdetail.sFirst[CurrentRow]>
        

        <cfquery name="aggdata" 
                datasource="#request.DB#">
         Select ISNULL(Sum(nc.nNumHrs), 0) as AggHours
         From HospitalLog nc
         Where cHospitalCodeID =498
         and nc.iEmpID = '#QRYnc.iEmpID#'
         and nc.dDate>= '#variables.Fiscal#'
         and nc.dDate <= '#QRYnc.TrainDate#'
         Group by nc.iEmpID, nc.dDate
         Order By nc.iEmpID, nc.dDate
       </cfquery>

        <cfset Suparray[CurrentRow][7] = 
               aggdata.AggHours[CurrentRow]>

</cfloop>

I am thinking it may have to do with the fact that
each iEmpID appears in the HospitalLog table more than
once or maybe it has nothing to do with that....am new
to arrays and am at a loss as to how to fix this....
Any ideas?????

Thanks again for your help!!!!!!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to