I am trying to find in the database all the records I am interested in and made this query for this purpose.
SELECT *
FROM public.offer
WHERE status = ‘1’
AND created_at BETWEEN ‘2024-05-07’ AND ‘2024-05-07’;
Dates, respectively, are dynamic. The problem is that the second date is considered incorrectly. For example, if I need to find records for the period from May 6 to May 7 and if I specify the corresponding dates as parameters, it will return records only for the 6th day. To find records from 6 to 7 inclusive, I have to specify dates from 6 to 8 as parameters.
Could you please tell me what I need to change to make the search inclusive of these dates when specifying the dates?