0

I am unable to format the below query intending to display the column-alias total re-formatted to display as dollars. Though unsuccessful, I suspect a nested solution combined with TO_CHAR, is appropriate but I haven't succeeded with my attempts.

SELECT SUM(TO_CHAR(invoice_total,'999,999ドル.99')) AS "Total Invoice Amount"
FROM company.invoices;

Can anyone please assist? Thank you.

asked Mar 2, 2016 at 22:32
1
  • 2
    SUM(TO_CHAR(invoice_total)) does not make sense. You can't sum a varchar. You want to_char(sum(invoice_total)). Commented Mar 2, 2016 at 22:36

1 Answer 1

0

This was a simple-syntax issue, which I unable to see due to my growing frustration-thank you.

SELECT TO_CHAR(sum(invoice_total),'999,999ドル.99') AS "Total Invoice Amount"
FROM company.invoices;
answered Mar 2, 2016 at 22:50

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.