Q:

SQL Query (written in Python) is return an error

EDIT: The issue was I needed a space in the SQL Command that wasn't present. Some other users suggested I'm using some bad syntax, which might also be true, but this is all set now.
My query works fine in a .dqy file, or in microsoft sql studio, but it's presenting this error when I try to run it in Python:

('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL
  Server]"RMORHP" is not a recognized table hints option. If it is
  intended as a parameter to a table-valued function or to the
  CHANGETABLE function, ensure that your database compatibility mode is
  set to 90. (321) (SQLExecDirectW)')

I'm not sure what that means or how to adjust my script. I assume I'm making a bad call somewhere but I don't know where. The database itself is an enterprise solution, so I need to change my query, not the database.
Code:
import pyodbc
import pandas as pd
cnxn = pyodbc.connect("Driver=SQL Server;"
                      "Server=server;"
                      "Database=database;"
                      "Trusted_Connection=yes;"
                      "APP=Microsoft Office 2010")
#cursor = cnxn.cursor()
SQLCommand =("SELECT DISTINCT CONCAT(RMORHP.ORHCUSCHN, '-', RMORHP.ORHCUSNUM) As 'Customer Number', RMCUSP.CUSCUSNAM As 'Customer Name', RMORHP.ORHDELDTE As 'Delivery Date', Count(RMORHP.ORHORDNUM) As 'Order Count'"
             "FROM BIDW_DataLake.erms.RMORHP RMORHP, BIDW_DataLake.eRMS.RMCUSP RMCUSP"
             "WHERE (RMORHP.ORHDELDTE Between 20181010 And 20181011) AND RMORHP.ORHORDQTY > 0 AND RMCUSP.CUSCUSCHN = RMORHP.ORHCUSCHN AND RMCUSP.CUSCUSNUM = RMORHP.ORHCUSNUM AND RMCUSP.CUSDFTDCN = 505"
             "GROUP BY CONCAT(RMORHP.ORHCUSCHN, '-', RMORHP.ORHCUSNUM), RMCUSP.CUSCUSNAM, RMORHP.ORHDELDTE"
             "ORDER BY [Delivery Date], [Customer Number]")
df = pd.read_sql_query(SQLCommand, cnxn)
#cursor.execute(SQLCommand)
#for row in cursor:
#    print('row = %r' % (row,))
cnxn.close()

A:

SQLCommand is missing spaces between each line and this can trigger your error. I added spaces after " in lines 2 to 5.
SQLCommand =("SELECT DISTINCT CONCAT(RMORHP.ORHCUSCHN, '-', RMORHP.ORHCUSNUM) As 'Customer Number', RMCUSP.CUSCUSNAM As 'Customer Name', RMORHP.ORHDELDTE As 'Delivery Date', Count(RMORHP.ORHORDNUM) As 'Order Count'"
             " FROM BIDW_DataLake.erms.RMORHP RMORHP, BIDW_DataLake.eRMS.RMCUSP RMCUSP"
             " WHERE (RMORHP.ORHDELDTE Between 20181010 And 20181011) AND RMORHP.ORHORDQTY > 0 AND RMCUSP.CUSCUSCHN = RMORHP.ORHCUSCHN AND RMCUSP.CUSCUSNUM = RMORHP.ORHCUSNUM AND RMCUSP.CUSDFTDCN = 505"
             " GROUP BY CONCAT(RMORHP.ORHCUSCHN, '-', RMORHP.ORHCUSNUM), RMCUSP.CUSCUSNAM, RMORHP.ORHDELDTE"
             " ORDER BY [Delivery Date], [Customer Number]")

