On closer inspection it is the Cast to CHAR that is causing the problem. I've now created this as a new topic in the WMQI/WBIMB forum and will consider this one closed.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum