How to customize the numbering in a query?

J

Jon

I want to customize the numbering in a query. In other word, I want to make
customized numbering in a column in query but as formatted below:
001
002
003
…
…
etc
any help please?
 
S

Steve

Hello Jon,

The table in your query must contain a unique index such as an autonumer
field. As an example in a report of customers, CustomerID would be a unique
field used in the query.
Example: To list all customers in the table, "TblCustomer" and auto number
the output rows, you would enter the following in a blank field of the
customers query:
RowNum: (Select Count (*) FROM [TblCustomer] as Temp
WHERE [Temp].[CustomerID] < [TblCustomer].[CustomerID])+1

To get the format you want, you would then need to add another field to your
query:
CustomRowNum:Format([RowNum],"000")

Steve
(e-mail address removed)
 
M

Mariusz Wisniewski

On Sat, 22 May 2010 19:18:58 -0400,
Hello Jon,

The table in your query must contain a unique index such as an autonumer
field. As an example in a report of customers, CustomerID would be a unique
field used in the query.
Example: To list all customers in the table, "TblCustomer" and auto number
the output rows, you would enter the following in a blank field of the
customers query:
RowNum: (Select Count (*) FROM [TblCustomer] as Temp
WHERE [Temp].[CustomerID] < [TblCustomer].[CustomerID])+1

To get the format you want, you would then need to add another field to your
query:
CustomRowNum:Format([RowNum],"000")

Steve
(e-mail address removed)


Jon said:
I want to customize the numbering in a query. In other word, I want to make
customized numbering in a column in query but as formatted below:
001
002
003
.
.
etc
any help please?
test
 

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