Searching for a Date


Im getting some problems with my search filter. Right now the filter is almost ready but the date field does not return any values.
The condition that i'm using right for the date is this one.

Italia_IT_PT.Unloading_Place like "%" + Procurar + "%" or
DateToText(Italia_IT_PT.Loading_Date) like "%" + Procurar + "%" or 
DateToText(Italia_IT_PT.Unloading_Date) like "%" + Procurar + "%"

Anything wrong with this?
Which is the best way to search by dates.

What is Procurar? Can you give some sample data?


Procurar is the Local Variable which holds the value from the Input of Searching.

date comparisons is like comparing integers..

what you are showing is to match a text-represent of an date, which is a bit strange.

better to have a different filter for the date.

So, do you sugest to create another input to search by the dates, and the type of the input beeing "Number"?

your query is still correct, may be you input wrong format. I tried this :


Henrique Leite wrote:

So, do you sugest to create another input to search by the dates, and the type of the input beeing "Number"?

yes and no (no because you also don't use a number)

Because you have no clue how the user will put the date inside the text-field.

DateToText will be a specific format, so that should match or not.

Use the input_calendar widget for search on date, much more user-friendly.

- do you want to search on a specific date, or from a certain-date etc.

- perhaps even a range of dates.

- your original query should work if you enter something like "2017", but then you get every record where the date was in the year 2017.. not sure if you want that...


I will try to find the best way to filter the date.

Another thing. Can I mask a input, in order to let the user put in date 27092017 and the format will be 27-09-2017. I already seen the CustomMask, and I adapt for my perferences, but in the version that I am working (7.0) right now, I didnt find something like that.


beware that because you are using an very old (26 September 2014) version of the platform the answers can be totally wrong, because there are patterns which did not exist in that platform.

Next time, when asking a question provide the versioning also in the question itself like [7.0] How can I...

When people are answering your question they normally tend to test it on their own PE which is P10.

Sometimes even built-in functions can be differently implemented

On that note, is there a specific reason why you are still on that version?

support is long gone on that version afaik?

Im using this version because im working in a local server in this moment. Is temporary but until get the new version I will be compiling the tools in this version.

About the CustomMask, do the version 7.0 have something like the CustomMask in version 10?

HI Henry,

Would you like to open a new thread to not surrogate this topic?



Yes, ofc.