DATETIME2FROMPARTS alternatives for SQL Server 2008 I am trying to part a datetime value and build it together removing minutes, seconds and so on. I want the values to be hourly.

Usually this works on a SQL Server 2012 machine:

DATETIME2FROMPARTS( DATEPART(year, datum), DATEPART(month, datum), DATEPART(day, datum), DATEPART(hour, datum), 0, 0, 0, 0) as dtHour


But unfortunately in SQL Server 2008 it does not! Which function do I need, to fulfill the same job?

I also looked up this reference: Date&amp;Time functions but this were all only SQL Server 2012 compliant.
You can make it a bit shorter.

dateadd(hour, datediff(hour, 0, datum), 0)


This calculates the number of hours between 1900-01-01 00:00:00.000  and datum and adds that value to 1900-01-01 00:00:00.000.