how to Chage date Frormat mm-dd-yyyy to dd-mm-yyyy in query calculated filed

  • hi  i am new in this fourm

     

    Kindly advise us

    My Query

    DATEADD(DAY, 45, tbl_ppm_report.PPM_Date)     Result  = mm/dd/yyy

    guide us how to convert it on dd.mm.yyyy

     

     

  • You can use the convert function to specify which style you want to see.  To get the style that you want you need to use style number 104 (you can read about all styles in the help about convert function).

    select convert(char(10),getdate(),104)

    Personally I think that the presentation layer should take care of the date format and not the database.  If you do it in the SQL Server, then you'll might need to duplicate the code if you'll have a user/customer that needs the date to be in a different format.

     

    Adi

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply