Friday, March 9, 2012

Retrieving an Answer from Mulitple ResultSet statements

I have several ResultSet Querys/Statements within my page. An example
of the code looks like this:

ResultSet rs1 = stmt1.executeQuery("SELECT right('
' + '$' + convert(varchar,SUM(ActivePrim),1), 15) AS 'ActivePrim',
right(' ' + '$' + convert(varchar,SUM(KGAP),1), 15) AS
'KGAP', right(' ' + '$' +
convert(varchar,SUM(PrimaryRepo),1), 15) AS 'PrimaryRepo', right('
' + '$' + convert(varchar,SUM(WeeklyTotal),1), 15) AS
'WeeklyTotal' FROM Intranet..InsuranceStats WHERE EmployeeName =
'Jamie' and Date BETWEEN '01/01/04' and '01/31/04'");

What would be the correct way to retrieve each result set? I
currently have it as the example below. But this doesn't allow for
each result set to be displayed separately.

<td valign=top><b>Active Primary:</b><%= ActivePrim %></td
Any help would be greatly appreciated.

Catherineclequieu@.nuvell.com (Catherine) wrote in message news:<a0edee50.0404051011.1235b95c@.posting.google.com>...
> I have several ResultSet Querys/Statements within my page. An example
> of the code looks like this:
> ResultSet rs1 = stmt1.executeQuery("SELECT right('
> ' + '$' + convert(varchar,SUM(ActivePrim),1), 15) AS 'ActivePrim',
> right(' ' + '$' + convert(varchar,SUM(KGAP),1), 15) AS
> 'KGAP', right(' ' + '$' +
> convert(varchar,SUM(PrimaryRepo),1), 15) AS 'PrimaryRepo', right('
> ' + '$' + convert(varchar,SUM(WeeklyTotal),1), 15) AS
> 'WeeklyTotal' FROM Intranet..InsuranceStats WHERE EmployeeName =
> 'Jamie' and Date BETWEEN '01/01/04' and '01/31/04'");
> What would be the correct way to retrieve each result set? I
> currently have it as the example below. But this doesn't allow for
> each result set to be displayed separately.
> <td valign=top><b>Active Primary:</b><%= ActivePrim %></td>
> Any help would be greatly appreciated.
> Catherine

You'll probably get a better answer to this in an ASP forum.

Simon

No comments:

Post a Comment