asim1985, Your SQL statement should look something like the statement below. When using $X you do not need to specify the IN sql operator before it. zamudio Code:and sp.fin_id=fm.fy_id /* after commenting records were came in large no i.e no of records increases */ /*and p.fin_id=fm.fin_id */ /* Reason for commenting fin id of property is null*/--and p.sac_no in(/*'BX1408080030000',*/'BX1408080110000'/*,'BX1408230020013','BX1408230020036','BX1408090000002','BX1408070070000','BX1408090000000'*/)and ($X{IN,p.sac_no,SAC_NO})