Adding a Autonumbering Field

G

Guest

I have a database which is composed of data which is imported through Visual
Basic Script and then manipulated with many Queries. After a while I need to
have a field produce a running total, which i have figured out a formula for,
using DSum. However, I need a field of Autonumbered cells to Guarentee that
the data will add up correctly. Is there any way to create a query which will
create an autonumbering field in an existing table?
 
M

Michel Walsh

Hi,


We don't really need an autonumber to make a running sum, we just need a
field, f1, without duplicated values:


SELECT a.f1, SUM(b.f2)
FROM myTable as a INNER JOIN myTable as b ON a.f1 >= b.f1
GROUP BY a.f1



Hoping it may help,
Vanderghast, Access MVP
 
G

Guest

However, there in lies my problem. I do not have a field without duplicated
values. I have a date field, however there are rows with duplicated dates.
 
M

Michel Walsh

Hi,


You can then append the data to an empty table that has an autonumber field,
in addition to the other fields. Just append the existing fields, the
autonumber field will be filled automatically.


Hoping it may help,
Vanderghast, Access MVP
 

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