Record Count

Hemish

Registered User.
Local time
Today, 10:46
Joined
Jan 20, 2005
Messages
65
Hi,

I'm trying to write some code in Access 2000. What i'm trying to do is count the number of records and update the coloum (Number). At the moment the column Number is blank. (I have just put in test data as example.) What i want to do is count the number of records and update the number coloum in sequence order, where the Name colum and date column are the same. If they are not the same then it will start at 1 again and carry on until it has gone through all the records.


Name_____Date___________Number
H_______ 01/01/2005___________1
H_______01/01/2005___________2
H_______01/01/2005 ___________3
H_______23/01/2005___________1
S_______01/01/2005___________1
S_______23/01/2005___________1
S_______30/01/2005___________1
S_______30/01/2005___________2
 
Dont think you have to do any counting here just compare the current records to the previous records if they are both identical then set the record count to plus one if they are not identical then set it back to one and repeat the process for all records
 
Hemish,

You don't have to store the count, you can calculate it with a query.

Select Name, Date, Count(*) As TheCount
From YourTable
Group By Name, Date

Also, don't use Name & Date for the names of YOUR things, Access has
those words reserved.

Wayne
 
Hi,

I know how to group and count. I need to know how to update each field. Eg if there are 5 in the group then i will have to update record 1 to 1 record to 2 record to 3 record 4 to record 5 to 5. Then start on the next group.

etc
 

Users who are viewing this thread

Back
Top Bottom