Results 1 to 3 of 3

Thread: Problem SUM()

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Posts
    1,384

    Problem SUM()

    Hi all,

    I have 2 tables. i. tblBookHdr - containing my Booking Header Information incl. GroupNo, BookID and BookFee. ii. tblBookDets - Containing BookID (links to tblBookHdr) and Desc.
    A number of different bookings (BookingIDs) may be made under the one group(#). A booking may have a booking fee. A booking can contain a number of line items.

    So Group# ABC contains 3 Bookings: i. 123 has a BookingFee of €5 and contains 3 line items ii. 456 has a Booking Fee of €10 and 1 line item and iii. 789 has no Booking Fee and 1 line.

    I have my report A. by Group# and B. by BookID. I am showing my BookDets in the report Details section and I want to show a Sum of my Booking Fee in the Group# Footer Section. My total Booking Fee should be €15 however it is showing €25. This is because the data selection for my report i.e.
    SELECT tblBookHdr.ID, tblBookHdr.GroupNo, tblBookHdr.BookingFee, tblBookDets.Desc FROM tblBookHdr INNER JOIN tblBookDets ON tblBookHdr.ID = tblBookDets.BookingID WHERE (((tblBookHdr.GroupNo)=’ABC’));

    So the report is showing a total Booking Fee of €25. How do I fix the report to display the correct amount?

    Thanking you in advance,
    Mel.
    Last edited by mel_flynn; Feb 16th, 2009 at 04:26 PM.
    Mel

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