• DBA-640728 (5/6/2009)


    thank you so much!!! one last question, i did this in my testing environment and worked perfectly; however in my production env i have replication, would this represent a problem to my subscriber?

    Careful! This doesn't hold true when GETDATE() returns a PM time. CONVERT(int, <datetime>) rounds to the nearest int - not truncates.

    Try it out:

    DECLARE @pm_date datetime;

    SET @pm_date = '20120131 12:00:01';

    SELECT

    DATEDIFF(DAY, '19000101', @pm_date),

    CAST(@pm_date AS int)