custom search query

Questions related to using nuBuilder Forte.

custom search query

Postby Timo » Mon Mar 19, 2018 1:43 am

If I understand the function nuForm() correctly, when the parameter string4 is specified, a where clause is built like
field1 like %searchstring% or field2 like %searchstring% or ...
It would come in handy if you could pass a custom where clause as parameter.
For example, in a browse form I could add two date fields with a filter button and could build queries like
date_field BETWEEN '%date1%' AND '%date2%' .There are endless more examples. This would give much more flexibility.
nuForm() could recognize if hash cookies are used as search string and then add the custom where clause instead of building a like ... or ... like where clause.
Timo
 
Posts: 71
Joined: Fri Mar 16, 2018 5:56 am

Re: custom search query

Postby admin » Mon Mar 19, 2018 8:47 am

Timo,

You can.

You need to put BETWEEN '%date1%' AND '%date2%' in a Hash Cookie - and use that Hash Cookie in the Form's SQL.

https://wiki.nubuilder.net/nubuilderforte/index.php/Hash_Cookies#Custom_SQL


Steven
admin
Site Admin
 
Posts: 2483
Joined: Mon Jun 15, 2009 9:53 am

Re: custom search query

Postby Timo » Wed Mar 21, 2018 12:17 pm

All right, I'll give it a go
Timo
 
Posts: 71
Joined: Fri Mar 16, 2018 5:56 am

Re: custom search query

Postby admin » Thu Mar 22, 2018 6:54 am

.
admin
Site Admin
 
Posts: 2483
Joined: Mon Jun 15, 2009 9:53 am


Return to General