Home Forums SQL Server 2005 T-SQL (SS2K5) datetime => how to have complete date with 00:00:00.000 RE: datetime => how to have complete date with 00:00:00.000

  • A number of ways of doing this:

    SELECTCONVERT(datetime,CONVERT(char(8),MyDateTimeColumn,112))

    FROM MyTable

    or

    SELECTCONVERT(datetime,DATEDIFF(DD,0,MyDateTimeColumn))

    FROM MyTable

    Hope that helps.

    Mike