Fixed the issue in Migration
#Calculated the value earlier and injected afterwards in query