condition = mpi Tmpvar =count( mpi )

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'mpi'.

/niddkweb/table_stat_result.asp, line 85

I get this error when i try to count the number of subjects in a table. Here the tablename and the field to which the total number are imported. My sql statement is

Mydb.dbSQL = "select" & Tmpvar & " From " &session("Ti&#34


What should i change to make it work?
Thanks in advance,
Kwan.