Mh Dip
Mh Dip

Reputation: 351

How to convert number to month name in PostgreSQL?

I m trying to convert string number to month name but i searched a lot of resources but it didn't help me.

here is my query

SELECT CAST(extract('month'
                    FROM to_date(proforma_invoice_date, 'DD/MM/YYYY')) AS VARCHAR) AS proforma_invoice_date
FROM proforma_invoice

Here is my output...

enter image description here

Upvotes: 4

Views: 8755

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1271241

Use to_char():

to_char(to_date(proforma_invoice_date, 'DD/MM/YYYY'), 'Month')

Upvotes: 11

Related Questions