• Peter, the following code:

    select cast(cast(getdate() as int) as datetime)

    will give incorrect results if the time is in the afternoon.

    However, the code that Simon wrote:

    select cast(floor(cast(getdate() as float)) as datetime)

    gives the correct result.

    Razvan