Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Access -- Updating a Field with "Cumulative" Data 1

Status
Not open for further replies.

BizDev

Technical User
Aug 21, 2009
13
US
Hey everybody, first time poster here.

Here's my situation. I have a table that basically looks like this...

Field Names:

Item
Date
Qty1
Qty2
Net
Cumulative

There is accurate data in all of the fields, except for cumulative. I have the data sorted ascending by Item, then ascending by date.

What I am trying to do is basically this:

If [Item] != (prior record)[Item], [Net], [Net]+(prior record)[Net]

Does that make sense? Basically, I want to plot out what the net qtys will be, over a course of time. Should I use visual basic for this? Write a query? I'm by no means a programmer and was wondering if anyone could help. I would greatly appreciate it. :)
 
Yes, they are denormalized. This isn't a production database with dynamic data going in/out on a daily basis. It's more for reporting/analysis look at daily/weekly/monthly/quarterly/etc. snapshots in time.

I added in the aliases as you showed and it works like a charm. Thank you _so_ much.

If you'll indulge me, what is the point of the alias table name, it seems key to the sum calculation, but I can't wrap my mind around why.
 
Very cool-- I did not know that, thank you.

With over 500,000 records, and needing to do 3 of these "cumes" in the same table (or recordset), I'm beginning to understand why calculated records shouldn't be stored (or created in the first place). This query hard on the cpu.
 
Holy...

Yes. That made a _world_ of difference. Wow. You rock, Duane.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top