Hi
The Macro template was referring to the old code that's why it generateswrong sql.Now the changes made in RM1840 are incorporated into macro template as well.
Please find attached patch.
ThanksSurinder Kumar