Wim,

You say you have two functions that use the SQL() function. And you say that both functions are always called twice, right? If so we need more input as we tested it and can't duplicate this.