@halton I take this variable as a indicator to say if add "AND" before next conditional clause. The first Where conditional clause doesn't need "AND' a head of it. But I don't know which clause will be come the first one. So I check it everything before append clause. If one hit, "hasAnd" will set to true. Please move to 8 lines down, you will see "hasAnd = true;"