MarkMpn / Sql4Cds

SQL 4 CDS core engine and XrmToolbox tool
MIT License
74 stars 22 forks source link

Cannot seem to compare two fields of type string from two different entities #500

Closed stephencqub closed 2 months ago

stephencqub commented 2 months ago

Quite a simple query. Happy to provide any other details.

the odd thing is that replacing the 'not equal to' with an equal to does work ok.

I feel it must be user error but I have a blind spot at the moment! Any help appreciated.

select count(*) from contact inner join new_ds_questionnaire ON contact.contactid = new_ds_questionnaire.new_contact where new_ds_questionnaire.new_student_number != contact.new_pse_personalid

new_student_number is of type string new_pse_personalid is of type string

The error message is: Msg 10337, Level 16, State 1, Line 45 'new_ds_questionnaire' entity doesn't contain attribute with Name = 'new_pse_personalid' and NameMapping = 'Logical'. MetadataCacheDetails: ProviderType=Dynamic, StandardCache=True, IsLoadedInStagedContext = False, Timestamp=2085650397, MinActiveRowVersion=2085650397, MetadataInstanceId=63035259, LastUpdated=2024-07-02 07:19:12.803, OrgId=80ce9259-31c0-ee11-9073-000d3ab73d54

See the Execution Plan tab for details of where this error occurred

Completion time: 2024-07-03T22:52:56.5331506+01:00

MarkMpn commented 2 months ago

Thanks - this looks like the same issue as #486 and will be fixed in the next update

stephencqub commented 2 months ago

Thank you very much, Mark.