I have the following query in a stored procedure in SQL server:
FROM #tmpLESImport TLI
INNER JOIN tbl_LES L
AND TLI.PL IS NOT NULL
GROUP BY LESNumber
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or  are not allowed. Change the alias to a valid name.
SELECT INTO a table, it creates the table (in this case, a temp table). In order to create a table, each column needs a name, which your
count column does not. You just need to give it a name:
SELECT TLI.LESNumber,COUNT(TLT.PL) [NumRecords] INTO #PWCM FROM #tmpLESImport TLI ...