我正在尝试将变量传递给 SOQL 语句,我正在使用 simple_salesforce 库。我只需要在 Opportunity 的 CreateDate 大于昨天时抓取数据,昨天的日期保存在last_run_day
变量中。下面是我的代码:
yesterday = date.today() + timedelta(days=-1)
last_run_date = yesterday.strftime("%Y-%m-%d"+"T"+"%H:%M:%S"+"Z")
sf_data = sf.query_all("SELECT ID, Name FROM Opportunity where probability > 0 AND CreatedDate > '%s' AND AdPoint_Id__c <> NULL ORDER BY AdPoint_Id__c" % last_run_date)
print(sf_data)
给我一个错误:字段 'CreatedDate' 必须是 dateTime 类型,并且不应包含在引号中", 'errorCode': 'INVALID_FIELD'