Python Forum
Thread Rating:
  • 4 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Working
#1
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)
Reply


Messages In This Thread
Not Working - by gcryall - Jan-12-2019, 04:47 PM
RE: Not Working - by stullis - Jan-12-2019, 05:59 PM
RE: Not Working - by gcryall - Jan-12-2019, 07:44 PM
RE: Not Working - by stullis - Jan-12-2019, 08:28 PM
RE: Not Working - by gcryall - Jan-12-2019, 10:48 PM
RE: Not Working - by stullis - Jan-12-2019, 11:35 PM
RE: Not Working - by gcryall - Jan-13-2019, 01:44 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020