PDA

View Full Version : Search doesn't find existing dates


ABC123

Howard G. Cornett
09-14-2004, 06:45 AM
I have a grid component with a search. Whenever I try to search on a particular date, it accepts the search as valid but shows no records found when I KNOW that the particular date HAS records. I can even go into the table from the control panel and see records with the date I searched on. Any ideas why this might be happening?

Howard

Selwyn Rabins
09-14-2004, 10:50 AM
if you use the sample demo pages, and search on the date field in the invoice_header component, does it work for you?

for example, i tested:
InvoiceHead Grid - Tabular layout based on a view

i did a search on one of the invoice dates, and it worked fine.

if you have an example that fails, please send it to me.

Howard G. Cornett
09-14-2004, 11:51 AM
I emailed the database directly to you, Selwyn.

Howard

Selwyn Rabins
09-14-2004, 12:13 PM
the problem is that you have defined an index with this expression

WE_DATE+LASTNAME+FIRSTNAME


in previous versions of a5, this would have have been allowed, because we_date is a date value and lastname and firstname are character values.
but alpha five, as a convenience, allows this, and it automatically casts we_date into a character value.

however, in the case of an index this is fatal because it confuses lightening query optimization.

if you define your index correctly, as:

DTOC(WE_DATE)+LASTNAME+FIRSTNAME

then it will work