B
Bas Cost Budde
I created custom filtering for my user. In the process a NOT EXISTS
subquery may be created, which produces a set of IDs.
I join the original table to this set, and have a crosstab on this. Now,
Access complains that it cannot resolve the alias I need for the NOT
EXISTS. The message must be similar to
"cannot recognize buiten.ID as a valid fieldname or expression"
where 'buiten' is my alias. (It means outer, but that is a reserved word
in SQL)
Note that if another rule than fltcost17 is used, and this rule doesn't
contain the (NOT) EXISTS, all works fine!
This is most of my SQL code, maybe somebody can read it.
crosstab query, upper level:
TRANSFORM First(vlRelatie_s.waarde) AS EersteVanwaarde
SELECT vlRelatie_s.relatieID, vlRelatie_s.rtype, vlRelatie_s.naam
FROM vlRelatie_s INNER JOIN fltcost_AutGron ON vlRelatie_s.relatieID =
fltcost_AutGron.relatieID
GROUP BY vlRelatie_s.relatieID, vlRelatie_s.rtype, vlRelatie_s.naam
PIVOT [veldtitel] & [volgnummer];
right branch:
fltcost_AutGron (allows for multiple criteria extension hence the alias.
You figure the next alias name?)
SELECT DISTINCT L1.relatieID
FROM fltcost17 AS L1;
fltcost17 (one line of the rule set):
SELECT DISTINCT buiten.relatieID
FROM relatieveldwaarde AS buiten
WHERE (((Exists (SELECT relatieID FROM Relatieveldwaarde WHERE
relatieID=buiten.relatieID AND veldID=141))<>False));
(I have my feelings about this rewriting of otherwise correct syntax,
but is that the issue here?)
Relatieveldwaarde is a table containing relatieID, veldID, volgnummer,
waarde
left branch:
vlRelatie_s basically retrieves several column sources, defined in table
USysViewConfig, from Relatieveldwaarde
SELECT Relatie.relatieID, Relatietype.omschrijving AS rtype,
Relatie.naam, vRelatieveldwaarde.veldtitel,
vRelatieveldwaarde.volgnummer, vRelatieveldwaarde.waarde,
USysViewConfig.volgorde, USysViewConfig.breedte
FROM Relatietype INNER JOIN ((Relatie INNER JOIN vRelatieveldwaarde ON
Relatie.relatieID = vRelatieveldwaarde.relatieID) INNER JOIN
USysViewConfig ON vRelatieveldwaarde.veldtitel =
USysViewConfig.veldtitel) ON Relatietype.relatietypeID =
Relatie.relatietypeID
WHERE (((Relatie.status)<>'weg') AND
((USysViewConfig.operator)=getdatabaseuser()));
this one does what it should.
subquery may be created, which produces a set of IDs.
I join the original table to this set, and have a crosstab on this. Now,
Access complains that it cannot resolve the alias I need for the NOT
EXISTS. The message must be similar to
"cannot recognize buiten.ID as a valid fieldname or expression"
where 'buiten' is my alias. (It means outer, but that is a reserved word
in SQL)
Note that if another rule than fltcost17 is used, and this rule doesn't
contain the (NOT) EXISTS, all works fine!
This is most of my SQL code, maybe somebody can read it.
crosstab query, upper level:
TRANSFORM First(vlRelatie_s.waarde) AS EersteVanwaarde
SELECT vlRelatie_s.relatieID, vlRelatie_s.rtype, vlRelatie_s.naam
FROM vlRelatie_s INNER JOIN fltcost_AutGron ON vlRelatie_s.relatieID =
fltcost_AutGron.relatieID
GROUP BY vlRelatie_s.relatieID, vlRelatie_s.rtype, vlRelatie_s.naam
PIVOT [veldtitel] & [volgnummer];
right branch:
fltcost_AutGron (allows for multiple criteria extension hence the alias.
You figure the next alias name?)
SELECT DISTINCT L1.relatieID
FROM fltcost17 AS L1;
fltcost17 (one line of the rule set):
SELECT DISTINCT buiten.relatieID
FROM relatieveldwaarde AS buiten
WHERE (((Exists (SELECT relatieID FROM Relatieveldwaarde WHERE
relatieID=buiten.relatieID AND veldID=141))<>False));
(I have my feelings about this rewriting of otherwise correct syntax,
but is that the issue here?)
Relatieveldwaarde is a table containing relatieID, veldID, volgnummer,
waarde
left branch:
vlRelatie_s basically retrieves several column sources, defined in table
USysViewConfig, from Relatieveldwaarde
SELECT Relatie.relatieID, Relatietype.omschrijving AS rtype,
Relatie.naam, vRelatieveldwaarde.veldtitel,
vRelatieveldwaarde.volgnummer, vRelatieveldwaarde.waarde,
USysViewConfig.volgorde, USysViewConfig.breedte
FROM Relatietype INNER JOIN ((Relatie INNER JOIN vRelatieveldwaarde ON
Relatie.relatieID = vRelatieveldwaarde.relatieID) INNER JOIN
USysViewConfig ON vRelatieveldwaarde.veldtitel =
USysViewConfig.veldtitel) ON Relatietype.relatietypeID =
Relatie.relatietypeID
WHERE (((Relatie.status)<>'weg') AND
((USysViewConfig.operator)=getdatabaseuser()));
this one does what it should.