Requeired Date format : 13 Sep, 2012

  • Hi,

    am using below statement in a select statement,

    " e.expiration_date" is a date fromat column,

    i want the date should be displayed in 13 Sep, 2012 fromat.

    case when ( rtrim(e.expiration_date)is null OR RTRIM (e.expiration_date) = '') then ''

    else ' (Expires ' + rtrim(e.talent_expiration_date) + ')' end +

    Please help

  • See CAST AND CONVERT http://msdn.microsoft.com/en-us/library/ms187928(v=sql.105).aspx

    There are loads of date formats available, though you may have to truncate the time portion.

    You need something like

    SELECT CONVERT(e.expiration_date, varchar(11), 130) AS Expiration_Date;

  • Skanda (9/13/2012)


    Hi,

    am using below statement in a select statement,

    " e.expiration_date" is a date fromat column,

    i want the date should be displayed in 13 Sep, 2012 fromat.

    case when ( rtrim(e.expiration_date)is null OR RTRIM (e.expiration_date) = '') then ''

    else ' (Expires ' + rtrim(e.talent_expiration_date) + ')' end +

    Please help

    I'm lost. Are you saying that the column e.expiration_date is defined as a date data type?

    Now for the standard comment, you really should do your formatting of dates in the UI (User interface, application, report, etc), not in the SQL query.

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

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