cancel
Showing results for 
Search instead for 
Did you mean: 

How to select with datetime where condition on Sap Cpq?

sbslmhmt
Participant
301

Hello,

I want to select from custom table based on a datetime field.

Here is my code:

import datetime
adate = datetime.datetime.now().replace(hour=0, minute=0, second=1)
a = SqlHelper.GetList("select Kur from KurTablosu WHERE KurTarihi = '"+adate+"'")<br>

Code throws below error:

unsupported operand type(s) for +: 'str' and 'datetime'

Anyone knows how to make it work?

Accepted Solutions (1)

Accepted Solutions (1)

sbslmhmt
Participant
0 Kudos

Found it if anyone needs it;

a = SqlHelper.GetList("select Kur, KurTarihi from KurTablosu WHERE KurTarihi = '"+adate.strftime("%m/%d/%Y %H:%M:%S")+"'")

Answers (0)