Make sure that you have perfectly entered the Tutorial: What are Table Occurrences? and field names.
Try putting quotes around your field and table occurrence names:
ExecuteSQL ("SELECT COUNT (DISTINCT \"udleveret til\") FROM \"District\"" ; "" ; "")
I'm guessing that the space in your field name is the problem. If so, quoting the field name should correct the error.
great that was the trick
Thnks a lot for your help works like expected