On 6/1/12 12:39 PM, Coop, Michael wrote:
>
> self.PrimaryBizobj.filterByExpression("lower(name_field)
> like '%mike%'")
>
>
>
> But, I'm getting an error:
>
>
>
> [rec for rec in self if lower(rec['name_field']) like '%mike%']
>
> SyntaxError: invalid syntax
>
>
>
> The SQL statement works fine natively in MySQL. What would be the
> correct syntax for the Dabo filterByExpression method?
The expressions need to be python, not sql. Try:
search_word = "Mike"
self.PrimaryBizobj.filterByExpression("%s.lower() in name_field.lower()" %
search_word)
(untested)
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]