You are not joining your 2 tables. You must either join them or omit the TYPE_DONATION table if it doesn't need to be there. Glen
-----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of iqbal_delphidev Sent: Sunday, 30 March 2008 4:35 PM To: [email protected] Subject: [delphi-en] Re: SQL PROBLEM why you are using 'D_AMOUNT' in GROUP BY clause: Try the following: select DISTINCT SUM(D_AMOUNT) ,D_TYPE FROM TYPE_DONATION, DONATIONS WHERE TYPE_DONATION. DONATION_ ID IN (SELECT DISTINCT DONATION_ID FROM DONATIONS WHERE MEMID = 4) GROUP BY D_TYPE thanks __________ NOD32 2984 (20080329) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com [Non-text portions of this message have been removed]

