[英]Wildcard in SOQL python
I am trying to query from salesforce using python using simple_salesforce package.我正在尝试使用 python 使用 simple_salesforce package 从 salesforce 查询。 When I do wildcard, it is throwing me Malfunction error.
当我使用通配符时,它会抛出故障错误。
soql = """SELECT {} FROM Contact where LastModifiedDate like "%2020-06-16%" """.format(','.join(field_names))
results = sf.query_all(soql)
Error错误
line 1:1374 no viable alternative at character
The date filter is wrong, This field is of type DateTime, not Date日期过滤器错误,此字段的类型为 DateTime,而不是 Date
You need to end up with something like你最终需要得到类似的东西
SELECT Id, FirstName, LastName, Email
FROM Contact
WHERE DAY_ONLY(LastModifiedDate) = 2020-06-15
Or或者
WHERE LastModifiedDate >= 2020-06-15T00:00:00Z
AND LastModifiedDate < 2020-06-16T00:00:00Z
There's a bunch of date conversion functions and special literals (not-really-constants) like TODAY, YESTERDAY, LAST_N_DAYS:123
有一堆日期转换函数和特殊文字(不是真正的常量),例如
TODAY, YESTERDAY, LAST_N_DAYS:123
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.