Home » Developer & Programmer » Reports & Discoverer » sum problem (report 6i.)
sum problem [message #649531] Wed, 30 March 2016 01:47 Go to next message
shahzad-ul-hasan
Messages: 566
Registered: August 2002
Senior Member
i have table (Student) which contains classes of students.i have another table which contain the absent of the students. if one student of any class not present in absent table the total strength of the students not calculated in summery column./forum/fa/13079/0/
  • Attachment: 41.JPG
    (Size: 45.07KB, Downloaded 415 times)
Re: sum problem [message #649535 is a reply to message #649531] Wed, 30 March 2016 02:52 Go to previous messageGo to next message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
So is the problem that records that are in the student table that don't appear in the absent table aren't listed in the report at all?
If so you probably need an outer join.
Re: sum problem [message #649981 is a reply to message #649535] Tue, 12 April 2016 00:54 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 566
Registered: August 2002
Senior Member
SELECT ALL ' '||STUDENT.CLASS||' ('||STUDENT.SECTION||')' cls, 
COUNT(STUDENT.STUID) css, COUNT(ABSENT1.ASTUID) aas, STUDENT.STUDENTID
FROM STUDENT, ABSENT, ABSENT1
WHERE (STUDENT.STATUS = 'PRESENT'
 AND ABSENT1.ABDATE(+) = :P
 AND STUDENT.DOA(+)<:P)
 AND ((ABSENT1.ABDATE = ABSENT.ABDATE(+))
 AND (STUDENT.STUID(+)= ABSENT1.ASTUID))
GROUP BY ' '||STUDENT.CLASS||' ('||STUDENT.SECTION||')', 
' '||STUDENT.CLASS||' ('||STUDENT.SECTION||')', STUDENT.STUDENTID 

this is the main report query.
Re: sum problem [message #649982 is a reply to message #649981] Tue, 12 April 2016 01:10 Go to previous messageGo to next message
Michel Cadot
Messages: 67446
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Re: sum problem [message #649990 is a reply to message #649982] Tue, 12 April 2016 03:42 Go to previous message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
You've tried to outer join every table in that query, why?
Previous Topic: After updating uifont.ali report copy paste giving junk chars
Next Topic: how to adjust Field height with maximum height of field
Goto Forum:
  


Current Time: Thu Oct 22 02:18:02 CDT 2020