Raj,
Then those memvars are in scope at the time you actually execute the query via macro expansion I am assuming. But if you looked at the SQL string in a messagebox all you will see is the memvar name.
You can use transform() to build SQL strings that would become independent on the memvars:
lcSQL = ... where field1 = " + transform( lnField1 ) ...
>Its working fine,I just ran it and its working fine.
>
>The same query when i am trying to show in a message box, that time its not showing the dates instead it is showing the variable names, thats why i thought the date vales are not carried over into query.