title: i am not getting the desired result from mysql query
body: <p>if i insert manualy in the table in database it shows the result in the grid but if i am entering from web page. it inserts in the database but not shoing in the result (grid in my page).</p>
  
  <p>my query is</p>
  
  <pre><code>Declare paramfkVoucherType int(11);
  
  SELECT ID INTO paramfkVoucherType 
  FROM ListOfValues_AccountVoucherType
  WHERE Name='Receipt Voucher';
  
  SELECT 
          V.ID as VoucherID,
          V.Code as VoucherNumber,
          V.ToFrom As `From`,
          V.Amount as Amount,
          V.IsPosted as IsPosted,
          V.PostedDate as PostedDate,
          V.IsApproved as IsApproved,
          V.ApprovalDate as ApprovalDate,
          V.VoucherDate as VoucherDate,
          V.IsEdited as IsEdit,
          V.EditedDate as EditedDate,
          VT.Name as VoucherType,
          V.Description as Description,
          U.UserName As CreatedBy
  FROM Account_Voucher V
  INNER JOIN ListOfValues_AccountVoucherType VT ON V.fkVoucherTypeID = VT.ID
  INNER JOIN usermanagement_user U ON U.ID =v.fkUserID
  WHERE (V.fkVoucherTypeID = paramfkVoucherType)
        AND (V.Code like concat('%',spVoucherNumber,'%') OR spVoucherNumber='')
        AND (Date(V.VoucherDate) BETWEEN DATE(spFromDate) AND DATE(spToDate)
             OR DATE(spFromDate)='1/1/0001'
             OR DATE(spToDate)='1/1/0001')
        AND (U.ID =spfkEmployeeID OR  spfkEmployeeID=0)
        AND (V.IsDeleted=0)
        AND (VT.IsDeleted=0);
  </code></pre>
  
  <p>i want to show it on grid. it is a search query for voucher.</p>
  
  <p>please help..</p>
  
  <p>thanks in advance.</p>