Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-03-05 : 07:31:59
|
| Jenny writes "Hi all,I have what I thought would be simple, but I haven't found the solution yet. Perhaps you can help....I simply need to return the sum of a column. Yup, that's it.I found a couple of articles, including the one here, but it doesn't help, except to tell me I need to use RETURN.[simplified only a little]CREATE STOREDPROC GetTotalASDECLARE @total intSELECT sum(fieldname) as @totalfrom.....RETURN @totalWell, this doesn't work. It says I get an error on the SELECT line...I will ultimatly use that value in an ASP.NET page.Thanks,Jenny" |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2003-03-05 : 08:02:48
|
| SELECT @total = sum(fieldname)from.....RETURN @totalJay White{0} |
 |
|
|
|
|
|