CPA_MCSE
asked on
How to substitute text in the select statement output?
I have only numeric values in a table. I want the output of a select statement to show text values rather than the numeric values. Modifying the table is not an option. I need to perform the substitution entirely within the select statement.
Select Example:
select period, sum(sales)
from salestable
Desired Output Example:
Apr 23,000
May 50,000
Table Data Example:
Period Sales
4 23,000
5 50,000
The actual data is much more complex, but a solution to the above should do it. Thanks in advance!
Select Example:
select period, sum(sales)
from salestable
Desired Output Example:
Apr 23,000
May 50,000
Table Data Example:
Period Sales
4 23,000
5 50,000
The actual data is much more complex, but a solution to the above should do it. Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use convert and convert styles
convert(datatype,expressio
e.g.
Open in new window