About Query Filtering
I have this 1 query component; just call it: qu_Browse.
The SQL statement of this query is like this:
QHEADER INNER JOIN
QHEADER.VendorCode = VENDORHEADER.VENDORCODE
From that query, I've used 'Fields Editor' and I set DISPLAY FORMAT for:
* QDate: mmmm dd, yyyy
So, if QDate = '01/30/1999', the display in dbgrid will be 'January 30, 1999'
* Validity: ##0 days
So, if Validity = '10', the display in dbgrid will be '10 days'
* TermOfPayment: ##0 days
Same with Validity.
My problem is this:
When I am in browsing mode (I've used DbGrid to show all data), I provide
a TEdit for searching data, and I use 'Filter' & 'FindFirst' for searching data.
When user wants to search based on QDate, he/she will type 'J', because in grid,
the display is 'January 30, 1999'. In fact, in the real data, it's not stored
like that, but '01/30/1999'. So, 'Filter' will be failed.
The error message is 'J*' is not valid date and time.
Oh yes, I always add '*' in the end of filter to make it more flexible.
This problem will occur too when user wants to search based on 'Validity' or 'TermOfPayment'.
How to solve this problem?
Like usual, need a help from any Delphi experts,