I appologize for not having been clear and for not having followed the instructions.

As you pointed out I made the tables reg and branch:

TBL_REG

Reg = number (either 1 or 2)

TBL_BRANCH

Branch = number (either 1 or 2)

Which I then made a cartesian query with the places table: QRY_Cartesian

TBL_PLACES

Placenr = number

Placename = text

Then I made a query with the suggested joins: QRY_Cartesian + data

TBL_DATA

Place number = number

Dreg = number

Dbranch = number

amount = number

__QRY_Cartesian__
SELECT TBL_PLACES.[Place nr], TBL_REG.Reg, TBL_Branch.Branch

FROM TBL_PLACES, TBL_REG, TBL_Branch;

QRY_Cartesian + data
SELECT QRY_Cartesian.[Place nr], QRY_Cartesian.Reg, QRY_Cartesian.Branch, Sum(TBL_Data.Amount) AS SumOfAmount, Count(TBL_Data.Place_number) AS CountOfPlace_number, IIf([reg]=[dreg],IIf([branch]=[dbranch],Sum([amount]),0),0) AS Expr1, IIf(Sum([amount])>0,Sum([amount]),0) AS Expr2

FROM QRY_Cartesian LEFT JOIN TBL_Data ON (QRY_Cartesian.Branch = TBL_Data.DBranch) AND (QRY_Cartesian.Reg = TBL_Data.Dreg) AND (QRY_Cartesian.[Place nr] = TBL_Data.Place_number)

GROUP BY QRY_Cartesian.[Place nr], QRY_Cartesian.Reg, QRY_Cartesian.Branch, TBL_Data.Dreg, TBL_Data.DBranch

ORDER BY QRY_Cartesian.[Place nr], QRY_Cartesian.Reg, QRY_Cartesian.Branch;

This gives me the output in the attachment:

I wondered if there was a more elegant (or less calculation intensive) way of getting the output of expr 1 or 2 (wich are identical) nstead of what is in column Sumofamount since the Real db contains about 19 million lines and takes some time to give the results?

The problem wich I had in my previous post with the count was due to my counting an unjoined field.

I apologize for my poor english and any further unclarity in my postings.