Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COALESCE

Status
Not open for further replies.

wexas45

MIS
Mar 11, 2010
9
0
0
GB
Hello All
Can you kindly advice what is wrong with this statement

COALESCE (SUM(Cost)) AS Cost,

I am getting this error

Msg 102, Level 15, State 1, Line 11
Incorrect syntax near ')'.




 
you forgot the second parameter -- COALESCE takes a minimum of two parameters (optionally, more than two)

if SUM(Cost) is NULL, what value do you want?

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
I presume you wanted this:
COALESCE (SUM(Cost)[!],0[/!]) AS Cost,

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top