Cannot call methods on char

This error seems to come from the following block of code. What is the possible cause of this error?

Unable to call method on char

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) <= @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) <= @iLastSoldWithinDays GROUP BY TerminalId )a ON (Terminal.TerminalId = a.TerminalId.TerminalId) ORDER BY a.TerminalId, SerialNumber 
+7
sql sql-server-2008 sql-server-2005
source share
1 answer

For this line:

 )a ON (Terminal.TerminalId = a.TerminalId.TerminalId) 

change it to this:

 )a ON (Terminal.TerminalId = a.TerminalId) 
+7
source share

All Articles