Problems with ordering and master detail relation
Hi,
is there any problems regarding ordering and setting master detail relation
between two queries? The problem is in one report with followin data
structure:
Master query and one detail query. If I set anything in the order by sql
part in the master query then the detail query is always empty.
Master query is:
*****************************
SELECT sznUcastniku.ID,
sznUcastniku.PoradoveCislo,
sznUcastniku.TridniKnihaID,
sznUcastniku.CustomPorCislo,
tblSznPrac.RodneCislo,
tblSznPrac.Prijmeni, tblSznPrac.Jmeno,
tblSznFirem.Nazev, tblSznFirem.Ulice,
tblSznFirem.Mesto
FROM sznUcastniku sznUcastniku
INNER JOIN sznPrihlOsoby sznPrihlOsoby ON
(sznPrihlOsoby.ID = sznUcastniku.PrihlOsobyID)
INNER JOIN tblSznPrac tblSznPrac ON
(tblSznPrac.ID = sznPrihlOsoby.PracovnikID)
LEFT OUTER JOIN tblSznFirem tblSznFirem ON
(tblSznFirem.ID = tblSznPrac.ZamestnavatelID)
Detail query is:
***********************
SELECT sznKUcastnika.ID,
sznKUcastnika.CelkoveHodnoceni,
sznKUcastnika.Kurz,
sznKUcastnika.Platnost,
sznKUcastnika.PoradoveCislo,
sznKUcastnika.SznUcastnikuID,
sznKUcastnika.KurzID,
sznKUcastnika.KGroupID
FROM sznKUcastnika sznKUcastnika
With this queries the detail query will be printed correctly. If I change
master query to:
Modified master query:
*************************
SELECT sznUcastniku.ID,
sznUcastniku.PoradoveCislo,
sznUcastniku.TridniKnihaID,
sznUcastniku.CustomPorCislo,
tblSznPrac.RodneCislo,
tblSznPrac.Prijmeni, tblSznPrac.Jmeno,
tblSznFirem.Nazev, tblSznFirem.Ulice,
tblSznFirem.Mesto
FROM sznUcastniku sznUcastniku
INNER JOIN sznPrihlOsoby sznPrihlOsoby ON
(sznPrihlOsoby.ID = sznUcastniku.PrihlOsobyID)
INNER JOIN tblSznPrac tblSznPrac ON
(tblSznPrac.ID = sznPrihlOsoby.PracovnikID)
LEFT OUTER JOIN tblSznFirem tblSznFirem ON
(tblSznFirem.ID = tblSznPrac.ZamestnavatelID)
ORDER BY sznUcastniku.PoradoveCislo <------- Added
the detail query is always empty. Why? The relation between queries is
DetailQuery.SznUcastnikuID -> MasterQuery.ID
The report is easy. In the detail band of main report is one subreport. Main
report get data from main query and subreport gets data from Detail query.
Thank for your help.
Petr Slipek
is there any problems regarding ordering and setting master detail relation
between two queries? The problem is in one report with followin data
structure:
Master query and one detail query. If I set anything in the order by sql
part in the master query then the detail query is always empty.
Master query is:
*****************************
SELECT sznUcastniku.ID,
sznUcastniku.PoradoveCislo,
sznUcastniku.TridniKnihaID,
sznUcastniku.CustomPorCislo,
tblSznPrac.RodneCislo,
tblSznPrac.Prijmeni, tblSznPrac.Jmeno,
tblSznFirem.Nazev, tblSznFirem.Ulice,
tblSznFirem.Mesto
FROM sznUcastniku sznUcastniku
INNER JOIN sznPrihlOsoby sznPrihlOsoby ON
(sznPrihlOsoby.ID = sznUcastniku.PrihlOsobyID)
INNER JOIN tblSznPrac tblSznPrac ON
(tblSznPrac.ID = sznPrihlOsoby.PracovnikID)
LEFT OUTER JOIN tblSznFirem tblSznFirem ON
(tblSznFirem.ID = tblSznPrac.ZamestnavatelID)
Detail query is:
***********************
SELECT sznKUcastnika.ID,
sznKUcastnika.CelkoveHodnoceni,
sznKUcastnika.Kurz,
sznKUcastnika.Platnost,
sznKUcastnika.PoradoveCislo,
sznKUcastnika.SznUcastnikuID,
sznKUcastnika.KurzID,
sznKUcastnika.KGroupID
FROM sznKUcastnika sznKUcastnika
With this queries the detail query will be printed correctly. If I change
master query to:
Modified master query:
*************************
SELECT sznUcastniku.ID,
sznUcastniku.PoradoveCislo,
sznUcastniku.TridniKnihaID,
sznUcastniku.CustomPorCislo,
tblSznPrac.RodneCislo,
tblSznPrac.Prijmeni, tblSznPrac.Jmeno,
tblSznFirem.Nazev, tblSznFirem.Ulice,
tblSznFirem.Mesto
FROM sznUcastniku sznUcastniku
INNER JOIN sznPrihlOsoby sznPrihlOsoby ON
(sznPrihlOsoby.ID = sznUcastniku.PrihlOsobyID)
INNER JOIN tblSznPrac tblSznPrac ON
(tblSznPrac.ID = sznPrihlOsoby.PracovnikID)
LEFT OUTER JOIN tblSznFirem tblSznFirem ON
(tblSznFirem.ID = tblSznPrac.ZamestnavatelID)
ORDER BY sznUcastniku.PoradoveCislo <------- Added
the detail query is always empty. Why? The relation between queries is
DetailQuery.SznUcastnikuID -> MasterQuery.ID
The report is easy. In the detail band of main report is one subreport. Main
report get data from main query and subreport gets data from Detail query.
Thank for your help.
Petr Slipek
This discussion has been closed.
Comments
such as 5.5x, there was a problem silmilar to this. Can you test with RB
7.02 trial if you are using an older version to see if the problem goes
away?
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Petr Slipek
a DBDemos database version in FF2 format but we have not been able to
reproduce the problem using that data.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I created test project and sended them to support.
Petr Slipek