• The DATE and TIME datatypes weren't introduced until SQL Server 2008, if you want the same query to work in 2005, you will have to stick with the combined DATETIME datatype.

    Note that Microsoft stopped supporting SQL Server 2005 earlier this year. If you can you may want to plan an upgrade depending on other software requirements:

    https://www.microsoft.com/en-us/cloud-platform/sql-server-2005