W
W. \Mark\ Xu
I am an Access user. When a database got too big and Access got too slow, I
switched to a combination of access.adp and sqlserver. I use both Access
2000 and SQL 2000.
I made the first stored procedure named "stoVolume" to create a few
variables from a few tables. It worked fine. When I click the stored
procedure it produce a table of the variables for me.
Alter Procedure stoVolume
As
SELECT
([expvol]*[tpacurr]) AS TREE,
COND.LANDCLCD,
CASE WHEN [SPGRPCD] <=24 THEN 'SW' ELSE 'HW' END AS MJSPGRP
FROM
TREE INNER JOIN COND ON
(COND.PLOT = PLOT.PLOT);
return
Now I want to sum the variable TREE by groups MJSPGRP and LANDCLCD. What
should I do? The following codes didn't work:
Create Procedure stoVolSum
As
Select Sum [TREE]
FROM stoVolSum
GROUP BY MJSPGRP, LANDCLCD;
return
I know it might seem funny to you, but I am really new to the store
procedure thing. Any suggestion is appreciated.
Mark
switched to a combination of access.adp and sqlserver. I use both Access
2000 and SQL 2000.
I made the first stored procedure named "stoVolume" to create a few
variables from a few tables. It worked fine. When I click the stored
procedure it produce a table of the variables for me.
Alter Procedure stoVolume
As
SELECT
([expvol]*[tpacurr]) AS TREE,
COND.LANDCLCD,
CASE WHEN [SPGRPCD] <=24 THEN 'SW' ELSE 'HW' END AS MJSPGRP
FROM
TREE INNER JOIN COND ON
(COND.PLOT = PLOT.PLOT);
return
Now I want to sum the variable TREE by groups MJSPGRP and LANDCLCD. What
should I do? The following codes didn't work:
Create Procedure stoVolSum
As
Select Sum [TREE]
FROM stoVolSum
GROUP BY MJSPGRP, LANDCLCD;
return
I know it might seem funny to you, but I am really new to the store
procedure thing. Any suggestion is appreciated.
Mark