I have been unsuccessful at getting this to display the way I want it to.
BOL says that convert(money, [expression] , 1) will display my sales figures
as 1,234,567.89. However the results for my query
SELECT TOP 100 PERCENT SalespersonID, convert(money, SUM(NetSales),1)
AS NetSales
GROUP BY SalespersonID
ORDER BY SalespersonID
returns the column NetSales as 1234567.89.
This is driving my boss crazy trying to determine whether the result is
$100,000 or $1,000,000.
Can someone explain this to me? The data type is already money, so I'm
wondering if it is just ignoring the convert...
I appreciate your help!Format at the client / presentation tier, because asking SQL Server to do
this is silly:
SELECT
'$'+REVERSE(SUBSTRING(REVERSE(CONVERT(VA
RCHAR(100),CONVERT(MONEY,money_colum
n),1)),1,100))
AS money_column
FROM table
"Chuck" <Chuck@.discussions.microsoft.com> wrote in message
news:B3584EDB-D8FA-422B-8A67-D2B45735E2ED@.microsoft.com...
>I have been unsuccessful at getting this to display the way I want it to.
> BOL says that convert(money, [expression] , 1) will display my sales
> figures
> as 1,234,567.89. However the results for my query
> SELECT TOP 100 PERCENT SalespersonID, convert(money, SUM(NetSales),1)
> AS NetSales
> GROUP BY SalespersonID
> ORDER BY SalespersonID
> returns the column NetSales as 1234567.89.
> This is driving my boss crazy trying to determine whether the result is
> $100,000 or $1,000,000.
> Can someone explain this to me? The data type is already money, so I'm
> wondering if it is just ignoring the convert...
> I appreciate your help!
>
No comments:
Post a Comment