Hawk Posted July 29, 2011 Share Posted July 29, 2011 I am using recordWalker to display data from an external data file. How can I display the number of records returned? I able to count all of the records in the file. I need to count just the records where customerID is equal to customer ID in the External Data files. Thanks, Larry Link to comment Share on other sites More sharing options...
step Posted July 29, 2011 Share Posted July 29, 2011 Could you just push them into an array based on whether or not the customerIDs from the internal and external data files match and then return the length of the array? Link to comment Share on other sites More sharing options...
Hawk Posted July 29, 2011 Author Share Posted July 29, 2011 I an trying what was suggested, but only getting a return value of 1. Here is the code. var ProdCount = ""; var numRecsExtDF = XDF5.recordCount; for (recordWalker=1; recordWalker <= numRecsExtDF; recordWalker++) { if (XDF5.GetFieldValue(recordWalker, 1) == Field("licenseid")) { ProdCount += recordWalker + ',' } } myCount +='' var myarray = [ProdCount]; return (myarray.length); If I return ProdCount and use that value as the array it works, but if I use the variable it counts it all as 1. Thanks, Larry Link to comment Share on other sites More sharing options...
Dan Korn Posted August 1, 2011 Share Posted August 1, 2011 You have it right here: var numRecsExtDF = XDF5.recordCount; You don't need to do any other calculations. Just return XDF5.recordCount (or numRecsExtDF). This simply creates an array with one item: var myarray = [ProdCount]; Which is why myarray.length is, of course, 1. Link to comment Share on other sites More sharing options...
Dan Korn Posted August 1, 2011 Share Posted August 1, 2011 If you want to return the number of matching records, do this: var ProdCount = 0; for (var i = 1; i <= XDF5.recordCount; i++) { if (XDF5.GetFieldValue(i, 1) == Field("licenseid")) ProdCount++; } return ProdCount; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.