• Hello,

    if you want to take off hours, minutes and seconds, getting only the "date" part of the calculated date, add this line of code:

    SET @r = cast(floor(cast(@R as FLOAT)) as DATETIME)

    Best wishes,

    Francesc