Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

swapna's avatar

date filter

select * from assignment where (assignment.agency_id = '102' and assignment.status = '1' and assignment.is_deleted = '0') and assignment_start_date >= '2018-01-01' and assignment_end_date <= '2018-06-05' .I wrote query like this but i have more than 10 assignments in this '2018-01-01'.but result is only one record "2018-01-01", " 2018-05-31"

0 likes
1 reply
_stefanzweifel's avatar

Are assignment_start_date and assignment_end_date dates or timestamps? You might want to change your query to include 2018-01-01 00:00:00 and 2018-06-05 23:59:59.

As you already know that you have more than 10 assignments, you should compare your query against the attributes of the assignments which are not returned by the query.

Please or to participate in this conversation.