Page 1 of 1

Extended search not working on Date field

Posted: Sat Sep 07, 2024 12:32 pm
by appsols

I have a field 'OrderDate' and I simply want to enable extended search on it. Whenever I enable extended search or filter, it displays the following error:
An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1.

I'm stuck here. Can someone help on this?
Thank you.


Re: Extended search not working on Date field

Posted: Sat Sep 07, 2024 12:48 pm
by arbei

First of all, if use lookup for that field, make sure you have enabled "Allow Sort/Search" under the Lookup Table panel.

Otherwise, you need to provide sufficient information so other users can try, e.g.

  1. Which version of PHPMaker?
  2. Which database? Data type of the date field.
  3. Language ID of your project, any change in date format of locale settings?
  4. Edit Tag of the field? How did you enter the value? What is the value you search?
    etc.

Re: Extended search not working on Date field

Posted: Sat Sep 07, 2024 1:08 pm
by appsols

I'm using latest version v2024.15 and using MySQL. I have tried both date and date&time, none of the formats working. I did not change anything in the locale settings and using the default language. The validation in the edit field is Date.

I've enabled AutoUpdateValue as CurrentDate().


Re: Extended search not working on Date field

Posted: Sun Sep 08, 2024 9:54 am
by arbei

AutoUpdateValue is for inserting records, not for searching.

arbei wrote:

You need to provide sufficient information so other users can try, e.g.

  • Language ID of your project,
  • Edit Tag of the field? How did you enter the value? What is the value you search?
    etc.

Re: Extended search not working on Date field

Posted: Sun Sep 08, 2024 12:43 pm
by appsols

The language ID is en-US

I have figured out the issue. The issue is due my modified values in row_rendered event as:

     $this->AdvOrderDate->ViewValue = "<p class= table-td>". $this->AdvOrderDate->ViewValue. "</p>";

Whenever I remove this, it starts working. Is there any way to maintain the formatting of fields and applying filter or extended search?


Re: Extended search not working on Date field

Posted: Sun Sep 08, 2024 4:18 pm
by arbei

You may check RowType before setting the ViewValue, search "RowType" in this forum to find more info.