Extended search not working on Date field

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
appsols
User
Posts: 53

Extended search not working on Date field

Post 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.


arbei
User
Posts: 9787

Post 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.

appsols
User
Posts: 53

Post 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().


arbei
User
Posts: 9787

Post 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.

appsols
User
Posts: 53

Post 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?


arbei
User
Posts: 9787

Post by arbei »

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


Post Reply