title: Cannot call methods on char
body: <p>This error seems to be coming from the following block of code. what is the possible cause of this error?</p>
  
  <blockquote>
    <p>Cannot call method on char</p>
  </blockquote>
  
  <pre><code>INSERT INTO #ActiveTerminals
  SELECT DISTINCT a.TerminalId, SerialNumber, a.[LoadTime] [LastSale] 
  FROM Terminal INNER JOIN
  (
      SELECT DISTINCT Ticket.TerminalId,max(LoadTime) [LoadTime] FROM 
      Ticket with (NOLOCK)
      JOIN ProductDenomination with (NOLOCK) ON (ProductDenomination.DenominationId = Ticket.DenominationId)
      WHERE ProductDenomination.ProductId NOT IN (SELECT * FROM dbo.fn_MVParam(@sExcludedProducts)) AND
       datediff(day,LoadTime,@dteActiveSalesEndDate) &lt;= @iLastSoldWithinDays
      GROUP BY TerminalId
  
      UNION ALL
  
      SELECT DISTINCT VarTicket.TerminalId, max(TransactionDate) [LoadTime]  FROM 
      VarTicket with (NOLOCK) 
      WHERE VarTicket.ProductId NOT IN (SELECT * FROM dbo.fn_MVParam(@sExcludedProducts)) AND
       VarTicket.TerminalId NOT IN (SELECT TerminalId FROM #ActiveTerminals)
      AND datediff(day,TransactionDate,@dteActiveSalesEndDate) &lt;= @iLastSoldWithinDays
      GROUP BY TerminalId
  )a ON (Terminal.TerminalId = a.TerminalId.TerminalId) 
  ORDER BY a.TerminalId, SerialNumber
  </code></pre>