Data Base Results

S

scottt40

When post results from a database using the insert data
base results, how can I sum a column for a specific
username. Do I have to add a custom script, or is there a
parameters dialog box somewhere to add a SQL statement.

Example:
I am collecting student data (username) on their total
time of exercise, and want to retrieve this data and sum
the totals. How do I best achieve this using FrontPage,
and can I do it with very little custom code?
 
J

Jim Buyens

-----Original Message-----
When post results from a database using the insert data
base results, how can I sum a column for a specific
username. Do I have to add a custom script, or is there
a parameters dialog box somewhere to add a SQL
statement.

Example:
I am collecting student data (username) on their total
time of exercise, and want to retrieve this data and sum
the totals. How do I best achieve this using FrontPage,
and can I do it with very little custom code?

If the page is only going to display one student at a
time, put two Database Results Regions on the page: one
that reports the detail info, and one that reports the
total.

To calculate the total, you'll need specify a custom
query on page 2 of the DRW. The SQL statement will look
something like:

SELECT Sum(exercisetime) AS totaltime
FROM exercises
WHERE username='::username::' ;

assuming username is a Text field in your exercises
table, and also the name of a form field that you use to
select the student.

You could also develop this query in Access, save it in
Access, and then report against the query rather than
against a "raw" table.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
|| Microsoft FrontPage Version 2002 Inside Out
|| Web Database Development Step by Step .NET Edition
|| Troubleshooting Microsoft FrontPage 2002
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top