|
|
 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

August 8th, 2007, 10:39 AM
|
|
Authorized User
|
|
Join Date: Jul 2007
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Grouping with calculated field in report
Hi,
I got a access table which is like the following
Group Description Amount
3000 Net Sales 100000
5000 Total Var Cost 75000
7000 Total Other Cost 20000
Now I need to make a Profit and loss statment out of the above table
The statement should look something like this
3000 Net Sales 100000
5000 Total Variable Cost 75000
6000 Gross Margin 25000
7000 Total Other Cost 20000
9000 Net Profit 5000
The 6000 and the 9000 group are not coming out of the table but are lables and the values of the amount are calculated field.
I have no idea how to get the calculated field in the report format. So far I have put all the three fields in the detail section of the report.
Any help is appreciated. Thanks.
|

August 8th, 2007, 11:22 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,060
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
If there is only one record in your detail section, then just drop some text boxes on the detail section and add this text:
6000 Gross Margin: =Sum([3000]-[5000)
9000 Net Profit: =Sum(([3000]-[5000])-[7000])
I am assuming the field names.
Did that help?
mmcdonal
|

August 8th, 2007, 05:56 PM
|
|
Authorized User
|
|
Join Date: Jul 2007
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Actually I am looking to have this done without hardcoding as once I am done with this report format, I need to pass paramter to manipulate few other fields that i do not have here. Any more thoughts. Thanks mmcdonal.
|

August 9th, 2007, 07:46 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,060
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Yes. Do this with a query then. Put all of your results either in a query, or in a temporary table, and base the report on the source you use.
For example, you could create a query that is:
SELECT tblMyTable.3000, tblMyTable.5000, tblMyTable.7000, Sum([3000]-[5000) AS 6000, Sum(([3000]-[5000])-[7000]) AS 9000 FROM tblMyTable
Then make this an append query and post it to a table where you are accumulating other data for you report. It would be flat with one record to source the report, but it is only a temp.
Anyway, there are lots of ways around this.
mmcdonal
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |