-6

I need to get SQL date from 2018-11-01 to nov-18.

Sefe
  • 13,731
  • 5
  • 42
  • 55
  • 2
    Who upvotes these questions? – Salman A Feb 22 '19 at 13:41
  • 1
    Personally, I'd worry about the display format in your presentation layer. Formatting a date means changing it from a `date(time)` data type to a `varchar`; which brings its own set of problems. – Thom A Feb 22 '19 at 13:44

1 Answers1

4

Use format()

DEMO

select format(cast('2018-11-01' as date),'MMM-yy', 'en-US')

OUTPUT:

dateval
Nov-18
Fahmi
  • 37,315
  • 5
  • 22
  • 31