Search code examples
sql-serverdate-conversion

sql server date stored in table comparing with the system date


really struggling to convert the below date format 10.11.2013 in the format of the system date.

I have a request to compare column data with the system date. In the column the date is storing as DD.MM.YYYY

Or we need to convert system date (getdate()) to the date values stored in the database table.

Thanks in Advance

Regards, Dev


Solution

  • try this:

    convert system date (getdate()) to the date values stored in the database table.

    Gives formats as DD.MM.YYYY

    select CONVERT( CHAR(10),GETDATE(),104) -- outputs 11.09.2014
    

    with Your Column

    select CONVERT( CHAR(10),MyColumn,104)