Page 1 of 1

Date search

Posted: Mon May 09, 2016 3:32 pm
by paolcon

Hi everybody, can you help me? Your product is realy the top, but i'm not.

I have a Datatime field "Service Date",
un search parameters i set

FieldSearch 1 >= (ServiceDate)

FieldSearch 2 <= (ServiceDate)

Can i set in default metodh FieldSearch2= (ServiceDate)+7 days ? example: FieldSearch 1 2016/05/09 and FieldSearch 2 in automatic 2016/05/16

Thanks


Re: Date search

Posted: Tue May 10, 2016 12:38 pm
by motfs

You can use the Recordset_SearchValidated server event to check if there is <Field>.AdvancedSearch.SeachValue2. If there is no value, you can get the SearchValue and convert it to DateTime and use DateTime.AddDays() to add the number of days. and convert it back to string (ToString(<format>)) and set the SearchValue2. See Server Events and Client Scripts -> Recordset_SearchValidated (Example) in help file for more details.