Hello every one ,
I’am creating new query report its fine and show data very fine , but filters is not working .
Any one can help me.
this is my query:
SELECT `tabMain Center Dispatch`.name,`tabMain Center Dispatch`.patient_name,`tabMain Center Dispatch`.governorate_name,`tabMain Center Dispatch`.visit_kind,`tabMain Center Dispatch`.hospital_name
from `tabMain Center Dispatch`
where `tabMain Center Dispatch`.governorate_name=%(governorate_name)s
@shadrak98
This is my query
SELECT tabMain Center Dispatch.name,tabMain Center Dispatch.patient_name,tabMain Center Dispatch.governorate_name,tabMain Center Dispatch.visit_kind,tabMain Center Dispatch.hospital_name
from tabMain Center Dispatch
where tabMain Center Dispatch.governorate_name=%(governorate_name)s
I’m having the exact same problem. Did you figure this out @zaidali ?
The issue appears to happen if I set up a non-mandatory filter. When the query runs and no value is supplied for the filter, I get the above error:
KeyError: `[field_name]`
The documentation is extremely sparse when it comes to using filters in query reports. Is there better documentation out there anywhere?
This is my WHERE clause:
(%(store)s IS NULL or wls.store = %(store)s)
AND (%(city)s IS NULL or s.city LIKE %(city)s)
AND (%(state)s IS NULL or s.state LIKE %(state)s)
AND rsvns.sides IS NULL OR rsvns.sides < 2