Closed edgeerrol87 closed 2 months ago
I'm struggling to reproduce this error. Can you simplify your query to use only standard entity types and still get the same error? So far I can't get it to generate the <attribute>
and <order>
elements within the Expr1
link entity. Can you also share the results of SELECT @@VERSION
?
I'm struggling to reproduce this error. Can you simplify your query to use only standard entity types and still get the same error? So far I can't get it to generate the
<attribute>
and<order>
elements within theExpr1
link entity. Can you also share the results ofSELECT @@VERSION
?
The result of SELECT @@VERSION
is
Microsoft Dataverse - 9.2.24061.186
SQL 4 CDS - 9.1.0.0
Jun 11 2024 21:15:27
Copyright © 2020 - 2024 Mark Carrington
The simplify query is
SELECT DISTINCT
c.contactid,
CASE
WHEN c.lastname = pc.lastname THEN 1
WHEN c.mobilephone = pc.mobilephone THEN 2
ELSE 0
END AS flag
FROM lead AS l
INNER JOIN contact AS c ON l.customerid = c.contactid
LEFT JOIN account AS ca ON c.contactid = ca.primarycontactid
INNER JOIN contact AS pc ON l.parentcontactid = pc.contactid
LEFT JOIN account AS pca ON c.contactid = pca.primarycontactid
WHERE c.contactid IN (SELECT contactid FROM contact WHERE modifiedon = today())
Thanks, that’s given me what I need to reproduce it, I should be able to get this fixed for the next release. In the meantime you should be able to avoid the error by rewriting your WHERE clause without the IN:
WHERE ccr.new_role = 100000000
AND c.modifiedon = yesterday()
AND c.statuscode = 100000000
Hi,
I use the version 9.1.0 and when I try to run this query
I have the following error:
I found a problem in line 747-748 of the Sql4Cds/MarkMpn.Sql4Cds.Engine/ExecutionPlan/FetchXmlScan.cs file with key
Expr1.new_contractid