Hello,
I'm doing some trials in building queries, after Issue 67530 has been
resolved (calculated fields).
It works fine now and then I'm trying to use this improvement to have,
in my project, one and only one instance for each calculated field. No
duplicates.
I can see two ways for this:
1) the ability to use alias for further expressions inside the same
query ( but this solution needs an enhancement not available yet, see
Issues 66837 and 67726)
2) using the new "queries in queries" feature, but here maybe I found a
bug (not sure).
These are the statements of three queries.
SELECT "TipoDoc", "NumDoc", CASEWHEN( "TipoDoc" = 'FAD', "Imp",
CASEWHEN( "TipoDoc" = 'FAN', "ImpND", CASEWHEN( "TipoDoc" = 'PAI',
"Imp", CASEWHEN( "TipoDoc" = 'PAE', "FCIVA", CASEWHEN( "TipoDoc" =
'PGE', "FCIVA", 0 ) ) ) ) ) AS "ImportoNetto" FROM "Cronologico" AS
"Cronologico"
SELECT "ImportiNetti"."TipoDoc", "ImportiNetti"."NumDoc",
"ImportiNetti"."ImportoNetto" * "Cronologico"."AliqPrev" / 100 AS
"Previdenza" FROM "ImportiNetti" AS "ImportiNetti", "Cronologico" AS
"Cronologico" WHERE ( "ImportiNetti"."TipoDoc" = "Cronologico"."TipoDoc"
AND "ImportiNetti"."NumDoc" = "Cronologico"."NumDoc" )
SELECT "ImportiNetti"."TipoDoc", "ImportiNetti"."NumDoc",
"ImportiNetti"."ImportoNetto" + "Previdenza"."Previdenza" AS
"Imponibile" FROM "Previdenza" AS "Previdenza", "ImportiNetti" AS
"ImportiNetti" WHERE ( "Previdenza"."TipoDoc" = "ImportiNetti"."TipoDoc"
AND "Previdenza"."NumDoc" = "ImportiNetti"."NumDoc" )
The first two work correctly, whereas the third one doesn't. It prompt
an error message as follows:
"The data content could not be loaded"
"The statement contains a cyclic reference to one or more sub queries"
Where is the cyclic reference? I cannot see any. Can someone help me,
please?
Best regards,
Franco
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]