How to get the date in mm/dd/yyyy

  • How to get the date in mm/dd/yyyy when column datatype in smalldatetime

  • grasshopper26 (5/3/2010)


    How to get the date in mm/dd/yyyy when column datatype in smalldatetime

    Date formatting should be done in the UI, not in SQL, but if you really need it, try this:

    select

    MyDateColumne,

    convert(varchar(10), MyDateColumn, 102) as NewDate

    from

    dbo.MyTable;

  • I tried the above but was not the mm/dd/yyy format and finally it by hit and trail

    Convert(Varchar(12),MilestoneDate_BeginDate,110)

    Thanks

  • grasshopper26 (5/3/2010)


    Convert(Varchar(12),MilestoneDate_BeginDate,110)

    What did you get with 102? Never mind, you really want 101 for mm/dd/yyyy. Crooked eyes on my part.

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

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