Sum Total in a Data Result Area

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

I want the data result area to just count and return the number of records
in a field. I do not want the data records to repeat. I can sum the column
but it repeats with each new record.

Your help appreciated.
S Taylor - LTC
 
-----Original Message-----
I want the data result area to just count and return the
number of records in a field. I do not want the data
records to repeat. I can sum the column but it repeats
with each new record.

Do you mean to write, "...the number of records in a
table"? If so, try

SELECT count(*) from <table_name>;

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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
yes.. the number of records in each "field" of a results table. The results
wizard puts a record set on the page but it does not count the total
entries. It simply repeats itself. All I want to see is one result that
reflects the total number of entries for a survey answer.

Thanks,
Steven
 
-----Original Message-----
yes.. the number of records in each "field" of a
results table. The results wizard puts a record set on
the page but it does not count the total entries. It
simply repeats itself. All I want to see is one result
that reflects the total number of entries for a survey
answer.

OK, that's different. If:

o Your table is named "survey"
o Each record contains the survey answers from one
respondent.
o A field named "answer1" contains each respondent's
answer to question 1.

Then the required SQL statement would be:

SELECT survey.answer1, Sum(1) AS answer1cnt
FROM survey
GROUP BY survey.answer1
ORDER BY survey.answer1;

To insert this, you would:

1. Start the Database Results Wizard.
2. Specify your table and then advance to step 2.
3. Click Custom Query and Edit.
4. Insert a SQL statement based on the above.

Hyperlink properties has nothing to do with it.

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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Back
Top