• CirquedeSQLeil (12/21/2009)


    I'm curious what the need is to convert a date to a Number. I would leave the date as one of the datetime datatype in sql 2005.

    Now to get the Date Format you seek, you will need to convert to varchar and check the following: http://www.sqlusa.com/bestpractices2005/centurydateformat/

    Actually, on the SQL side dropping the time portion off getdate is this simple:

    dateadd(dd, datediff(dd, 0, getdate()), 0)