Adding Sequential Numbers to a Query

S

Santi

What’s the correct format to use DCount function in Access? I’m trying to add
sequential numbers to the results on a query that’s based on several tables.
Does anyone know how to do that? In my query under design view I have a table
named “item†which from there I want the field named “No†to be the source to
determine how many records get counted.

Any help is greatly appreciated
 
J

John W. Vinson

What’s the correct format to use DCount function in Access? I’m trying to add
sequential numbers to the results on a query that’s based on several tables.
Does anyone know how to do that? In my query under design view I have a table
named “item” which from there I want the field named “No” to be the source to
determine how many records get counted.

Any help is greatly appreciated

I have no clue what the Item table is like or how it determines the count, nor
even what you're counting; but the syntax is pretty straightforward. DCount()
takes three arguments. The first can be just a text string "*" if you want to
count all records, or it can be a fieldname (in which case it will count all
non-NULL values of that field). The second argument is a string containing the
name of a table or query. The third, optional, argument is a text string
containing a valid SQL WHERE clause without the word WHERE, defining which
records in the table should be counted.

For example,

DCount("*", "PeopleTable", "[DOB] < #1/1/1950#")

will count the number of records in PeopleTable for which the DOB field is
prior to that date;

DCount("Zap", "qryAllZaps")

will count the number of records in qryAllZaps for which the field Zap is not
null.
 

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