I have this SQL query:
As you can see, it works fine. Except when I use it in Delphi.
I use TDBLookupComboBox, TEdit, and TButton. My idea is, whenever I click on the TButton, the EXE goes to check the table in SQL using information in the DBLookupComboBox and puts the result in the TEdit.
This is my Delphi code: