I'm taking data from one source and manipulating it in Access. It comes in an odd formatting and I'm not quite sure how to work with it.
The input data is a string with numbers separated by spaces. I want to get a sum total of the numbers. This is the correct function if written up in coldfusion, but I'd like to do the calculation in Access:
<cfscript>
function getAmount(_amountstring) {
var i=0;
var returnAmount=0;
for(i=1;i lte listLen(_amountstring," ");i=i+1) {
returnAmount=returnAmount+val(listGetAt(_amountstring,i," "));
}
return returnAmount;
}
</cfscript>
The input data is a string with numbers separated by spaces. I want to get a sum total of the numbers. This is the correct function if written up in coldfusion, but I'd like to do the calculation in Access:
<cfscript>
function getAmount(_amountstring) {
var i=0;
var returnAmount=0;
for(i=1;i lte listLen(_amountstring," ");i=i+1) {
returnAmount=returnAmount+val(listGetAt(_amountstring,i," "));
}
return returnAmount;
}
</cfscript>