[Top] [All Lists]

Re: Array argument array return

Subject: Re: Array argument array return
From: "C-Rock"
Date: Tue, 4 Mar 2008 19:35:41 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
I understand it much better now. So I got that working with what I needed 
except this. I can't get the count to work in CF. Everything I've read says I'm 
going it correctly. The database is returning id number 17 twice with the 
contract number in each one. The id 29 is returned only once because it has 
only one contract. so the result looks like this:

 item [1][1] = 17
 item [1][2] = 62356   - just a contact number
 item[2][1] = 17
 item[2][2] = 89564
 item[3][1] = 29
 item [3][2] = 12478

 instead of the contract number i want the number of contracts for each id. so 
it should look like this based on the above result:

 item [1][1] = 17
 item [1][2] = 2  - number of contracts
 item[2][1] = 29
 item[2][2] = 1

 I'm trying to use the count feature but I'm getting an error so this code 
isn't working. I was able to get the top code to return and work, I'm trying to 
get to the second set, which is the result I really want.


 <!-- shippers contracts -->
 <cffunction name="getShippersDetails" access="remote" returnType="query">
 <cfargument name="shippersList" type="string" required="yes">
 <cfargument name="shipperId" type="numeric" required="yes">
         <cfquery name="getShippersDetailsQuery" datasource="rexmap" 
username="****" password="****">
         SELECT COUNT(DISTINCT(tblcvp.cvpContract)), cvpPplFERC
         FROM tblcvp
         GROUP BY tblcvp.cvpPplFERC
         WHERE cvpPplFERC IN (<cfqueryParam value="#arguments.shippersList#" 
list="yes" cfSQLtype="CF_SQL_INTEGER">)
         AND cvpShprDUNS = #arguments.shipperId#
     <cfreturn getShippersDetailsQuery>
 <!-- -->
 <!-- -->
 <!-- -->

<Prev in Thread] Current Thread [Next in Thread>