How to find records in one table, where dates are BETWEEN two dates in another table

  • Something like this?

    SELECT

    dato

    FROM dbo.dutyrostershift d

    JOIN dbo.vacation v

    ON d.dato BETWEEN CAST(start-36163 AS datetime) AND CAST(fld_end-36163 AS datetime)

    AND d.employeeid = v.personalid

    WHERE d.shifttype = 2

    John

  • Thanks for showing my that the ON Clause is much more powerfull than i have seen.

    Best regards

    Edvard Korsbæk

Viewing 2 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply