calculating totals in .rdl report

Last post 09-03-2009, 2:46 AM by Wiston. 2 replies.
Sort Posts: Previous Next
  •  03-11-2009, 1:46 AM Post number 72438

    calculating totals in .rdl report

    I have two tables called Resource, and Comment


    table structure is
    1)Resource
    EntryNo                int
    ResourceNo        varchar(50)
    JobNo                varchar(50)
    Quantity        decimal(18, 0)

    2)comment tablr
    CommentNo        int
    CommentLineNo        int
    comment                ntext


    Relation between two table is EntryNo in Resourse table and the commentNo in comment table are the same and one entry number will have n number of  comment in comment table

    my job  is to create a .rdl report with this two bale with using below query


    SELECT     Rsource.EntryNo, Rsource.ResourceNo, Rsource.JobNo,  Rsource.Quantity, Comment.comment, Comment.CommentNo,Comment.CommentLineNo
    FROM         Rsource left outer JOIN
                          Comment ON Rsource.EntryNo = Comment.CommentNo


    its getting fine but when iam  caculating the total quantity for perticular entry no the total iam getting is wrong because of if quantity of perticular entryno is say 40 and this entry no is having 4 comments in comment table then the total quantity is 200(it is adding 4 times because i have 4 comments againest this entry no)

    Please suggest me how to get the exact total with out any duplication
  •  03-13-2009, 2:18 PM Post number 72476 in reply to post number 72438

    • Arles is not online. Last active: 03-19-2010, 3:36 PM Arles
    • Top 10 Contributor
    • Joined on 10-20-2008
    • Nashville, TN
    • Pentium Pro

    Re: calculating totals in .rdl report

    Do you have a sample report output?  I'm not sure how you got 200 with 4 comments and 40 entries, wouldn't that be 160?
  •  09-03-2009, 2:46 AM Post number 74637 in reply to post number 72438

    Re: calculating totals in .rdl report

    I'm using RAQ Report now. With it I can calculat totals easily. You can have a try. RAQ Report is free. You can get it at http://www.raqsoft.com/.

View as RSS news feed in XML