calculations on records

jamesd

Board Regular
Joined
Sep 22, 2003
Messages
220
I have a table with many 1000's of records.
Each record has a time field.
Can I calculate in a query record 1 minus record 2 .....record 2 minus record 3 ......record 3 minus record 4 ect
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
That kind of task is usually more of a kind of Excel task than an Access task. Relational databases really don't have that kind of relationship within records in the same table.

That being said, I know it can be done using ADO or DAO in VBA and looping through RecordSets and storing the result in a table. However, that wouldn't be dynamic, and if the any records are deleted, inserted, or re-sorted, your numbers probably won't look right.

Might I ask what exactly you need to do this for? If I understand your end goal, I may have some other suggestions for you.

If you are interested in a VBA solution, please let me know, and let me know how your records are ordered.
 
Upvote 0
skaas,

Based on the links your provided, I think you may have misread the question.

Within one table, I believe he wants to do a calculation where he subtracts a date field in a record from the date field in the previous record. The links you provided are useful for doing date calculations across fields in a single record, not across records.
 
Upvote 0
dead right
the reason I am trying to do it in access is the amount of records.
The table is the User pick table from a large warhouse and it records each user and pick and the time picked.
I need to work out units picked per hour and down time over a certain time ie more than 10mins.
there are in nealy a million records per week.
 
Upvote 0
there are in nealy a million records per week.
Have you done anything with it in Access yet? At that kind of size, it could potentially cause problems for Access too (especially if you are not deleting all the old records first).

If it gets too big for Access, it might require a more powerful database program like SQL or Oracle.

BTW, I believe that Excel 2007 can hold up to something like one million rows.
 
Upvote 0
My apologies :ROFLMAO:

I did miss-read - That is what I get for trying to do too many things at once :confused:

Over to you Joe ---->
 
Upvote 0

Forum statistics

Threads
1,214,576
Messages
6,120,350
Members
448,956
Latest member
Adamsxl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top