count in a field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Let say i have a table containing two fields with 5 records.both field's
record contain the value or character. Now i want to make a query such that
it has another field count how many records it has, so the query should be
like;

Count Field1 Field 2
1 A B
2 C D
3 E F
4 G H
5 I J

Now my question is how to make that "Count" field in the query. Please help

Regards,
jv
 
Hi all,

Let say i have a table containing two fields with 5 records.both field's
record contain the value or character. Now i want to make a query such that
it has another field count how many records it has, so the query should be
like;

Count Field1 Field 2
1 A B
2 C D
3 E F
4 G H
5 I J

Now my question is how to make that "Count" field in the query. Please help

I'm not sure I understand. An Access Table has no order; it's an
unordered "heap" of data. There is no record number. If you create a
Query you can specify a sort order - in this example, I'm guessing you
want to sort in ascending order of Field1.

It's easy to get a sequence number (I wouldn't really call it a
"count") on a Report; simply put a textbox on the report with a
Control Source of 1 and set its Running Sum property to "Over All". On
the other hand, if you just want to count how many records you have, a
Totals query

SELECT Count(*) FROM MyTable;

will be much simpler.

If you really need a sequence number in a Query, please post back
indicating how you want the data sorted, whether there might be ties
in Field1 and/or in Field2, and explain what you'll be doing with this
count.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top