I am trying to populate a multidimensional array with the number of records in a database that correspond to various application types. for some reason, i'm only getting values for the second row of the array....
If this description is vague, i apologize.
here is my code:
<%
String appYear = request.getParameter("appyear");
String[] appName = { "Deposit Account App", "Loans", "Small Business Deposit" };
String[] Month = { "01","02","03","04","05","06","07","08","09","10","11","12" };
int[][] monthlyTotal = new int[3][12];
int[] yearlyTotal = new int[3];
int[] monthlyAggregate = new int[12];
int ytdTotal = 0;
for(int i=0; i<appName.length; i++)
for(int j=0; j<Month.length; j++)
{
String query = "SELECT COUNT (*) FROM DBO.APPTRACK WHERE DATEPART(yyyy, LAST_MODIFIED) = " + appYear + "AND DATEPART(mm, LAST_MODIFIED) = " + Month[j] + " AND APPLICATION_NAME LIKE '" + appName[i] + " %'";
String[][] strResult = com.thebank.util.dbAgent.selectIntoArray(query);
int intResult = Integer.parseInt(strResult[1][0]);
//[1][0] b/c 1st row in db is field names
monthlyTotal[i][j] = intResult;
yearlyTotal[i] += monthlyTotal[i][j];
monthlyAggregate[j] += monthlyTotal[i][j];
ytdTotal += yearlyTotal[i];
}
%>
[ June 04, 2004: Message edited by: Bear Bibeault ]