0

Hi Everyone:*
I am working on Database project using DAO. Now I got a problem in counting all the data from one Field:-/ . Please help Me in this problem.
:confused: And Tell Me how can I get the total of any field by using SQL STATEMENT?
Thanks In Advance

3
Contributors
3
Replies
6
Views
10 Years
Discussion Span
Last Post by AV Manoharan
0

Hi,

Use This Query:
For Distinct Count:
Select Distinct Count(myfield) From Mytable

For Number Of Rrcords:
Select Distinct Count(*) From Mytable

For Sum:
Select Distinct Sum(amt_field) From Mytable


Regards
Veena

0

Hi,

Sorry, Remove Distinct In last 2 statements.

It may also give error.

For totalling a field always use a place holder using the key word AS

eg.

"SELECT SUM(myField) AS TtldField from mytable;"

regards
AV Manoharan

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.