Adding logic to prepare Select stmts; fixing issue where replaceAll of DateIn meta-SQL was used.