The result of a sql query
select PayerDate,PaymentAmount from Payments
PaymentAmount - decimal
Date Amount
12/11/2012 34.31
12/11/2012 95.60
12/11/2012 34.31
is that possible to get the result of query as below:
Date Amount
12/11/2012 $34.31
12/11/2012 $95.60
12/11/2012 $34.31
I have tried but couldn't find much info on this.
you can concatenate it on your projection statement,
In MySQL,
SELECT PayerDate, CONCAT('$', PaymentAmount) PaymentAmount
FROM Payments
In SQL Server,
SELECT PayerDate, '$' + CAST(PaymentAmount AS VARCHAR(15)) PaymentAmount
FROM Payments
Try this Query
select PayerDate,'$'+convert(varchar,PaymentAmount) as PaymentAmount
from Payments
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With