Hi ppl,
In my App, I need to get the count of registers that were created in the current year cause I want to create an id for other data that has the structure like this: [current year]-[00000n incrementaly], e.g., 2022-000001, 2022-000002, and so on…
My solution to this problem is as follows:
So, I need to know if that will work, because I can’t wait till next year to see if it will be fine, hehe.
Hi there, @wagbrig… what you are showing should work, but because advanced filters happen on the client side, I would probably go with a search with this constraint.
Hope this helps.
Best…
Mike
Hi, @mikeloc,
Your solution would not get data from 2023, 2024, etc.?
Maybe this one works good:
What do you say?
(And thanks for the reply!)
You said you needed this…
So, when the current date is in the year 2023, the search will return a count of the things created from the beginning of 2023 up to the current date of 2023. What am I missing here?
1 Like
An alternative to matching dates is to format both the date to “yyyymmdd” then convert to number. Do this for both dates then compare them as numbers. You can do this all in one statement.
You can do this to match with time by formatting to “yyyymmddhhmm” then convert to number.
I find this much more reliable in most cases.
1 Like