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

Thread: Distinct Sum!

  1. #1
    Join Date
    Dec 2007
    Posts
    11

    Distinct Sum!

    I have designed a report with 2 tables and a view from an sql database.
    In the detail section I have a field of the selection that is created by the report.That field is called 'bedaposo' and is a field from the view.
    The view has a column with a key that is unique for every row of the view(like the candidate keys of tables).
    The linking I have made with the linking expert brings me some rows with the same key.
    I give an example here.
    Original view :
    bedakey bedaposo
    12345 10
    12346 5
    12347 20
    12348 30

    query that is generated by the report :

    bedakey bedaposo
    12345 10
    12345 10
    12348 30
    12349 35

    I want to be able to generate by formula only and not by running total and grouping by the key a sum of the disticnt values of bedaposo.
    In this example

    10+30+35

    Thank you!

  2. #2
    Join Date
    Sep 2006
    Posts
    4

    Re: Distinct Sum!

    I had the same problem.
    After bouncing through the net i found this:

    http://www.crystalconsulting.ca/faq.html

    search for the "Creating Running Totals" section and follow the instructions.

  3. #3
    Join Date
    May 2006
    Posts
    324

    Re: Distinct Sum!

    If you're not expecting the duplicates then maybe your linking is wrong.
    You could also try ticking the Select Distinct Records option in the database menu.

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