help with this simple query,,, im just too new with this

G

Guest

simple -----> this is what i can do----result of my query example:

IdContrato sequence wight
1 01 3000
1 02 2000
1 03 1000
2 01 500
2 02 200
3 01 3000
3 02 1000
3 03 500
3 04 200

I need a field that accumulates the weigth for each IDContrato according to
the sequence order... i want it to show me this:

IdContrato sequence wight accumulated
1 01 3000 3000
1 02 2000 5000
1 03 1000 6000
2 01 500 500
2 02 200 700
3 01 3000 3000
3 02 1000 4000
3 03 500 500
3 04 200 700


PLEASE HELP ME... i KNOW THIS IS PRETTY EASY FOR YOU GUYS... NOT FOR ME




TKS


Andres Moreno
Bogotá Colombia
access 2003
 
R

Rick Brandt

andresmor said:
simple -----> this is what i can do----result of my query example:

IdContrato sequence wight
1 01 3000
1 02 2000
1 03 1000
2 01 500
2 02 200
3 01 3000
3 02 1000
3 03 500
3 04 200

I need a field that accumulates the weigth for each IDContrato
according to the sequence order... i want it to show me this:

IdContrato sequence wight accumulated
1 01 3000 3000
1 02 2000 5000
1 03 1000 6000
2 01 500 500
2 02 200 700
3 01 3000 3000
3 02 1000 4000
3 03 500 500
3 04 200 700


PLEASE HELP ME... i KNOW THIS IS PRETTY EASY FOR YOU GUYS... NOT FOR
ME

Actually this is very easy...in a report. It is not so easy in a query and even
if you can construct a query that will do it it will be very inefficient.

Reports are processed sequentially so running sums are easily tallied. Queries
are set-based so running sums have to be done by running correlated sub-queries
(a separate internal query that is executed for each and every row in your main
query's output).

Would a report satisfy your requirements? If so you just need to group on the
IdContrato field and put in a TextBox with a ControlSource of =[wight] and then
set the RunningSum property of that control to "Over Group".
 
G

Guest

thanks for your answer...
A report is ok... all i need is to show this on a screen. Could you please
be more specific on how to do this using a report.
 
G

Guest

forget about being more specific Rick..... I used the report and got the
results i needed... thanks for your help.
--
Andres Moreno
Bogotá Colombia
Windows XP PRO, Windows Media 10
Dell Axim X30-windows mobile 2003 SE


Rick Brandt said:
andresmor said:
simple -----> this is what i can do----result of my query example:

IdContrato sequence wight
1 01 3000
1 02 2000
1 03 1000
2 01 500
2 02 200
3 01 3000
3 02 1000
3 03 500
3 04 200

I need a field that accumulates the weigth for each IDContrato
according to the sequence order... i want it to show me this:

IdContrato sequence wight accumulated
1 01 3000 3000
1 02 2000 5000
1 03 1000 6000
2 01 500 500
2 02 200 700
3 01 3000 3000
3 02 1000 4000
3 03 500 500
3 04 200 700


PLEASE HELP ME... i KNOW THIS IS PRETTY EASY FOR YOU GUYS... NOT FOR
ME

Actually this is very easy...in a report. It is not so easy in a query and even
if you can construct a query that will do it it will be very inefficient.

Reports are processed sequentially so running sums are easily tallied. Queries
are set-based so running sums have to be done by running correlated sub-queries
(a separate internal query that is executed for each and every row in your main
query's output).

Would a report satisfy your requirements? If so you just need to group on the
IdContrato field and put in a TextBox with a ControlSource of =[wight] and then
set the RunningSum property of that control to "Over Group".
 

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

Similar Threads

Access Running Balance in Access 1
Running Balance (Debit and Credit) in Access 2007 4
Transpose table for report presentation 3
query result 1
Last day of month in query 15
add totals for each date 1
Running Sum 9
Group By query 1

Top