CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Data Report

  1. #1
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Data Report

    I have a data report that retrieves fields from a access database and also creates two calculated fields. ex. Sales | Cost| Profit| Margin. In the report footer I use the sum functions to add up the sales, the cost and the profit columns. How can I calculate the margin column. I need to use the sum(Profit) / sum(Sales) but I can't seem to figure this one out. Can you help?
    Thanks.



  2. #2
    Join Date
    Jul 1999
    Posts
    20

    Re: Data Report

    Hi,

    U can create Profit Margin (sum) by adding a formula field.

    1. Add a formula field
    2. Enter this formula in the above field
    "(Sum ({Table2.Sales}, {Table2.Sales})-Sum ({Table2.Cost}, {Table2.Sales}))/Sum ({Table2.Sales}, {Table2.Sales})"
    Here Sales and cost are the respective fields, which u can change.
    3. Place the field in the section where other sum are displayed.

    Hope this helps
    Regards
    Praba




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured