• If the values you are trying to match are set values like the example data you provided, then you should be able to come up with coding to match each criteria.

    Here is my attempt at the values shown in the example data:

    select a.*, b.*, c.*

    from #File_List a

    inner join #File_Dest b on

    a.file_id = b.file_id

    inner join #File_Schedule c on

    a.file_id = c.file_id

    where Due_Day = datename(dw, getdate()) -- if value in Due_day like 'Thursday'

    or (getdate() = (dateadd(dd, -1, dateadd(mm, 1, dateadd(dd, -day(getdate()), getdate())))) -- 'Last Day - 1'

    or (datename(dw, getdate()) = 'Monday'

    and day(getdate()) > 23

    and month(getdate()) not in (1, 3, 5, 7, 8, 10, 12)) -- last Monday

    -------------------------------------------------------------
    we travel not to escape life but for life not to escape us
    Don't fear failure, fear regret.