user macro uses select macro to generate sql