4

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

1
  • 3
    Unrelated to your problem, but: why are you storing DATE values in a varchar column? That is a really bad idea to begin with. Commented Dec 10, 2019 at 12:27

1 Answer 1

11

Use to_char():

to_char(to_date(proforma_invoice_date, 'DD/MM/YYYY'), 'Month')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.