# The SUM function requires 1 arguments.

This works fine, but the resulting value is w/out commas to the left of the decimal:  315683437.1000

SELECT SUM(LastFillQuantity*CAST(LastFillPrice AS Money)) AS 'Total \$ - '
where timeofexecution  >= left(getdate()-0, 11)
and destination = 'aaaa'

I usually do a conversion w/MONEY in order to get the commas in place -- like this query gives me this:
Stocks Volume -   232,096,074

SELECT 'Stocks Volume -   '+LTRIM(LEFT(CONVERT(char(16),CAST(SUM(LastFillQuantity) AS MONEY),1),13)),
+'Total # Trades - '+LTRIM(LEFT(CONVERT(char(16),CAST(count(*) AS MONEY),1),13))

but when i try that here, i get this:
Server: Msg 174, Level 15, State 1, Line 1
The SUM function requires 1 arguments.

SELECT CONVERT(varchar(15),CAST(SUM(LastFillQuantity*CAST(LastFillPrice AS Money),1) AS 'Total \$ - '
where timeofexecution  >= left(getdate()-0, 11)
and destination = 'aaaa'

any help?
LVL 1
###### Who is Participating?

Commented:
I've got it

SELECT CONVERT(varchar(15),SUM(LastFillQuantity*CAST(LastFillPrice AS Money)),1) AS 'Total \$ - '
where timeofexecution  >= left(getdate()-0, 11)
and destination = 'aaaa'
0

Commented:
Maybe this

SELECT CONVERT(varchar(15),SUM(LastFillQuantity*CAST(LastFillPrice AS Money))) AS 'Total \$ - '
where timeofexecution  >= left(getdate()-0, 11)
and destination = 'aaaa'

0

Author Commented:
no, that gives me this value:  315683437.10

i've always gotten my commas in place w/my money conversion.  it's just not happening this time, though
0

Author Commented:
Beauty!  I've been bothering over these two items for much of the afternoon.  Sometimes it's these little ones that will get ya.  I can't thank you enough.
0

Commented: