Search objects created in a month

Hi
is there a direct way to search using dates? using codeless
for example: get all objects created in this month.

Hello @mohammad_altoiher

I would say the question is more related to the general whereClause than to the codeless system. There are codeless blocks that accept the “where clause” string, so you just need to build the current query.

You can find on how to use dates in the query here:
https://backendless.com/docs/js/data_search_with_dates.html

Yes i seen that but i couldn’t find a direct way to compare months for example.

i was hoping that there is a way to extract the month from the date and search using the where clause to get the objects for that month

I see,

Yes, it is possible, here is an example for the first part of the query but at the end you need to get something like that created > '09/01/2021' and created < '09/30/2021'

1 Like

i was hoping that i would not have to do all of that to get the first day to be honest :slight_smile:
wish you guys will add this if possible in the future:

-first day in month of a date
-first day in year of a date

agree, I just created a ticket to discuss it with the team, the ticket’s number is BKNDLSS-26225

How about using generated columns for this?
Here’s what I have:

The columns are configured like this:

first day of the month:

first day of the year:

that a workaround
but is it ok to save that extra column to all the table objects? if you only need it on one query?
im playing with codeless date blocks and im a bit confused about the results. see the images of my test.

it is OK to add generated columns wherever you need them.

data_of_date - day of the month (2nd September)
day_of_date - day of the week (Thursday)
month_of_date - month index ([0..11])
1 Like

You guys should clarify this somewhere. i didn’t understand it from the blocks naming
my expected results

date_of_date - 9/2/2021
day_of_date - 2 [1-30]
month_of_date - 9 [1-12]

thanks @vladimir-upirov for making it clear!
and thanks @mark-piller i have used your solution and its working ok

thanks @mohammad_altoiher, I’ve added this recommendation to the ticket

Hello @mohammad_altoiher

We added the ability to choose the last day of the month for a block.

Regards,
Inna

1 Like