Wim,

Where did you put the function containing the SQL() statement?