Jan-12-2019, 04:47 PM
I'm a New Be and need help. I have a routine and it exasperates me....
I've executed a connection in a previous def and passed it . Why does this not work in the program?
Yet if I copy the the "print (SQL)" verbatim and use it in SQLite Editor in the "Execute Tab" it works.
computeNetPay(conn, ppeDate, intEmpID, intCmpID)
ppeDate = datetime(2019,2,23,0,0,0)
intEmpID = 1
intCmpID = 2
SQL = "SELECT * FROM Programs WHERE PPE_Date = '%s' AND EmployeeID = '%s' AND CompanyID = '%s'" % (ppeDate, intEmpID, intCmpID)
print (SQL)
NOTE: The print of the print (SQL) returns
"SELECT * FROM Programs WHERE PPE_Date = '2019-02-23 00:00:00' AND EmployeeID = '1' AND CompanyID = '2'"
cur = conn.cursor
cur.execute(SQL)
I've executed a connection in a previous def and passed it . Why does this not work in the program?
Yet if I copy the the "print (SQL)" verbatim and use it in SQLite Editor in the "Execute Tab" it works.
computeNetPay(conn, ppeDate, intEmpID, intCmpID)
ppeDate = datetime(2019,2,23,0,0,0)
intEmpID = 1
intCmpID = 2
SQL = "SELECT * FROM Programs WHERE PPE_Date = '%s' AND EmployeeID = '%s' AND CompanyID = '%s'" % (ppeDate, intEmpID, intCmpID)
print (SQL)
NOTE: The print of the print (SQL) returns
"SELECT * FROM Programs WHERE PPE_Date = '2019-02-23 00:00:00' AND EmployeeID = '1' AND CompanyID = '2'"
cur = conn.cursor
cur.execute(SQL)