I'm trying to add multiple tasks which match date and serial number. UI looks something like below.

First, you need to input start date, end date, and serial number. Then, it'll calculate date range between two date as on the right of the picture. Finally, I need to pull tasks and max ot with match criteria next to the date.

This is my sample data. If I search with criteria startDate=1/9/21, endDate=30/9/21, and S/N=FB/6, I will get tasks_ID=13,14,15 (within the same record) and OT=7.50.
Any suggestions are welcom.
Thanks,
FakeHungry