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 |
|
iancuct
Yak Posting Veteran
73 Posts |
Posted - 2002-09-30 : 10:11:49
|
| Hi I have a table that i want to do a running totals on one of the colums , the table is actually a querry , so i am doing a select withing a select but access does not let me save the query something about syntaxhere is my querrySELECT A.WeekEndingDate, A.SumOfBudgetedSpent, SUM(B.SumOfBudgetedSpent)FROM(( SELECT EVMS_SubTaskSpending.WeekEndingDate, Sum(EVMS_SubTaskSpending.BudgetedSpent) AS SumOfBudgetedSpentFROM EVMS_SubTaskSpendingWHERE (((EVMS_SubTaskSpending.ChargeNumber)=[Forms]![EVMS-Select Task]![cmb_ChargeNumber]) AND ((EVMS_SubTaskSpending.JobNumber)=[Forms]![EVMS-Select Task]![cmb_Job]))GROUP BY EVMS_SubTaskSpending.WeekEndingDate) AS ACROSS JOIN(SELECT EVMS_SubTaskSpending.WeekEndingDate, Sum(EVMS_SubTaskSpending.BudgetedSpent) AS SumOfBudgetedSpentFROM EVMS_SubTaskSpendingWHERE (((EVMS_SubTaskSpending.ChargeNumber)=[Forms]![EVMS-Select Task]![cmb_ChargeNumber]) AND ((EVMS_SubTaskSpending.JobNumber)=[Forms]![EVMS-Select Task]![cmb_Job]))GROUP BY EVMS_SubTaskSpending.WeekEndingDate) AS B)Where (B.WeekEndingDate<=A.WeekEndingDate) As RunningTotalGROUP BY A.WeekEndingDate, A.SumOfBudgetedSpentORDER BY A.WeekEndingDate, A.SumOfBudgetedSpentThis is the table that the subquery returnsso WeekEndingDate SumOfBudgetedSpent4/14/2002 $453.374/21/2002 $453.374/28/2002 $453.375/5/2002 $453.375/12/2002 $453.375/19/2002 $453.37i am tring to crossjoing the subqueries and geta variation of the above table with an additional column with the Cummulative SumOfBudgetedSpentso it would look something like thisWeekEndingDate SumOfBudgetedSpent4/14/2002 $453.374/21/2002 $906.744/28/2002 $1360.11why isn't access acepting my query please help |
|
|
|
|
|