<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>15 Apr 2016 14:57:00 Z</lastBuildDate><pubDate>12 Apr 2016 14:50:00 Z</pubDate><description>I can't find out what's wrong with below query.&#13;
It work ONLY in test mode with checked option:&#13;
"Run query without hQueryWithOutCorrection in test mode"&#13;
In app I get an error: "Aktivnost alias already used" (I do not use aliases)&#13;
Files are local HFSQLC/S. I checked every subquery one at time, and all worked as expected.&#13;
&#13;
Does somebody have an idea?&#13;
Is it allowed to use subquery inside subquery?&#13;
(It work in some other cases)&#13;
&#13;
SELECT Clan.ClanID AS ClanID, Oznaka.Oznaka AS Oznaka_Oz, Clan.Broj AS Broj, Clan.Prezime AS Prezime, Clan.Ime AS Ime, Titula.Naziv AS Naziv, Spol.Spol AS Spol, Clan.Adresa AS Adresa, Mjesto.PTT AS PTT, Mjesto.NazivMjesta AS NazivMjesta, Clan.StatusTip AS StatusTip, Clan.StatusDatumOD AS StatusDatumOD, Clan.StatusDatumDO AS StatusDatumDO, AktivnostUpit.sum_Bodovi, AktivnostUpit.sum_BodoviRegulativa, AktivnostUpit.sum_BodoviOpcenito, StatusNaDan.StatusTip AS StatusTipAktualni, StatusNaDan.Datum AS Datum FROM Clan LEFT OUTER JOIN Oznaka ON Clan.OznakaID = Oznaka.OznakaID LEFT OUTER JOIN Mjesto ON Clan.MjestoID = Mjesto.MjestoID LEFT OUTER JOIN Titula ON Clan.TitulaID = Titula.TitulaID LEFT OUTER JOIN Spol ON Clan.SpolID = Spol.SpolID LEFT OUTER JOIN ( SELECT StatusNaDan.ClanID AS ClanID, StatusNaDan.StatusTip AS StatusTip, StatusNaDan.Datum AS Datum FROM Status AS StatusNaDan INNER JOIN ( SELECT Status.ClanID AS ClanID, MAX(Status.Datum) AS maximum_Datum FROM Status WHERE Status.Datum BETWEEN {paramDatumOD} AND {paramDatumDO} GROUP BY Status.ClanID ) AS StatusMaxDate ON StatusNaDan.ClanID = StatusMaxDate.ClanID WHERE StatusNaDan.Datum = StatusMaxDate.maximum_Datum ) AS StatusNaDan ON Clan.ClanID = StatusNaDan.ClanID LEFT OUTER JOIN ( SELECT Aktivnost.ClanID, SUM(Aktivnost.Bodovi) AS sum_Bodovi, SUM(Aktivnost.BodoviRegulativa) AS sum_BodoviRegulativa, SUM(Aktivnost.BodoviOpcenito) AS sum_BodoviOpcenito FROM Aktivnost WHERE Aktivnost.Datum BETWEEN {paramDatumOD} AND {paramDatumDO} GROUP BY Aktivnost.ClanID ) AS AktivnostUpit ON Clan.ClanID = AktivnostUpit.ClanID ORDER BY Clan.Prezime, Clan.Ime</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please/read.awp</link><title>WD18 Queries, Subqueries, Problems... Help please</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57314/read.awp</comments><pubDate>15 Apr 2016 14:57:00 Z</pubDate><description>I put the cleaned project here:&#13;
&#13;
http://et35.square7.ch/public/Backup_eKomora_2016-04-15.ZIP&#13;
&#13;
So if someone is willing to lo…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57314/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57314/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please/read.awp">WD18 Queries, Subqueries, Problems... Help please</source><title>Re: WD18 Queries, Subqueries, Problems... Help please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57313/read.awp</comments><pubDate>15 Apr 2016 13:32:00 Z</pubDate><description>Hi,&#13;
&#13;
I would re-factor/simplify your nested SQL so that you can prove if nesting to the level you are trying is possible. Then…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57313/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57313/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please/read.awp">WD18 Queries, Subqueries, Problems... Help please</source><title>Re: WD18 Queries, Subqueries, Problems... Help please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57310/read.awp</comments><pubDate>15 Apr 2016 12:47:00 Z</pubDate><description>Hi,&#13;
&#13;
Maybe the fat that you are using a sum several times&#13;
&#13;
In the first select and later on&#13;
: SUM(Aktivnost.Bodovi&#13;
&#13;
Regar…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57310/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57310/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please/read.awp">WD18 Queries, Subqueries, Problems... Help please</source><title>Re: WD18 Queries, Subqueries, Problems... Help please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57275/read.awp</comments><pubDate>12 Apr 2016 21:13:00 Z</pubDate><description>Hi DarrenF, Peter,&#13;
Thanks for reply,&#13;
&#13;
I do not use HAlias() at all.&#13;
I did try many combinations, with and without AS keyword…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57275/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57275/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please/read.awp">WD18 Queries, Subqueries, Problems... Help please</source><title>Re: WD18 Queries, Subqueries, Problems... Help please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57271/read.awp</comments><pubDate>12 Apr 2016 17:06:00 Z</pubDate><description>Hi Marijan,&#13;
&#13;
Do you also execute your query in your app with the hQueryWithoutCorrection option?&#13;
&#13;
Cheers,&#13;
&#13;
Peter H.</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57271/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57271/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please/read.awp">WD18 Queries, Subqueries, Problems... Help please</source><title>Re: WD18 Queries, Subqueries, Problems... Help please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57270/read.awp</comments><pubDate>12 Apr 2016 16:00:00 Z</pubDate><description>Hi Marijan,&#13;
&#13;
There are alias's all over the SQL code you supplied (after the AS keyword), but I can't see from the SQL where y…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57270/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please-57270/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/57267-wd18-queries-subqueries-problems-help-please/read.awp">WD18 Queries, Subqueries, Problems... Help please</source><title>Re: WD18 Queries, Subqueries, Problems... Help please</title></item></channel></rss>
