• Lynn Pettis (12/21/2009)


    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)

    Noted and added to my toolbox - I had never used that method. Thanks Lynn.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events