on 2023 Apr 26 1:09 PM
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?
Found it if anyone needs it;
a = SqlHelper.GetList("select Kur, KurTarihi from KurTablosu WHERE KurTarihi = '"+adate.strftime("%m/%d/%Y %H:%M:%S")+"'")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
4 | |
4 | |
3 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.