How to: in Master/Detail list with preview arrow filter the detail

I have a Master/Detail report page where it connects employee attendance table reports to attendance details.

In short, I want that when opening the preview for the master,to have the detail filter according to some SQL I write, as the fields can’t be connected with normal master/detail field select (I need to filter according to part of the date in the detail.

Any tips?

Why not set the linked fields as those two fields when you create master/detail relationships between the master and detail table?