SQL error on template dataset using custom property in the where clause

Tip: rather than format each line of code individually, select the whole block and use the </> button. It gives syntax highlighting too. Please see Wiki - how to post code on this forum.