display date in format mm/yy or mm/yyyy

  • I'm pretty new to SQL programming (as you will probably be able to tell with my question). I need to be able to display the date returned from a query in the format mm/yy or mm/yyyy. I can use the various SQL formatting commands to format it mm/dd/yy or mm/dd/yyyy or dd/mm/yyyy, but nothing for the month and year only. How can this be accomplished easily? I need this functionality ASAP for a management report. Please help!

  • Can't you use your report writer for this?

    
    
    SELECT RIGHT(CONVERT(char(10),GETDATE(),103),7)

    --Jonathan



    --Jonathan

  • Thanks Jonathan. That worked great. It was just what I needed.

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

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