???? ID: 290136 - ????? ???????: 02 ?????? 2010 - ??????: 2.0

Microsoft Access ??? ??? ???? ??? ?????? ????? ?? ??? ???? ????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
?????: ?????? ???????? ??????, ?????????????? ?? multiuser ???? ???

?? ???? ?? Microsoft Access ??????? (.mdb) ????? ?? ??? ?? ???? Microsoft Access ??????? (.accdb) ????? ?? ??? ???? ???? ??????? Microsoft Access 2000 ??????? ?? ??? ?? ???? ??, ?????208714  (http://support.microsoft.com/kb/208714/EN-US/ ) .
???? Microsoft Access 97 ?? ??????? ?? ??? ?? ????, ?????138911  (http://support.microsoft.com/kb/138911/ ) .

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

?? ???? ????????? ???? ?? ?? ?? ??????? ??? ????? ????? ?? ??? ???? ??? ?????? ????? ?? ??? ?? ???? ???? ??? ???? ??? ?????? ?? ?????? ?? ??????? ???? ?? ???? ?? ????? ??????? ?? ??? summation ?? ???????? ?????? ?? ??? ??? ?????? ??? ?? ?????? ?? ?????? ????????? ???? ?? ??? ????? ??? ?????? ?? ?? ???? (?? ??? ?? ???? ?? ?? ???) ????? ?? ??????? ??? ?????? ???

???:?? ????? ????? Qrysmp00.exe ??? ?? ???? ??? ???????? ???? ???? ????? ?? ?? ???????? ??? ???? ???? ?? ????? ????? ??????? ???? ?? ??? ???? ???? ?? ???? ??? ??????? ?? ??? ????? ????? ???? ?? Microsoft ???????? ??? ?????:
207626  (http://support.microsoft.com/kb/207626/EN-US/ ) ACC2000: ????? 2000 ????? ???????? ?????? ??????? ?????? ???

???? ???????

?????? 1:

???? ???? ?? ????? ????DSumfunction and criteria in a query to create a running sum over time. TheDSumfunction sums the current record and any previous records. When the query moves to the next record, theDSumfunction runs again and updates the cumulative total.

The following sample query uses theOrderstable from the sample database Northwind to create a running sum of the freight costs for each month in 1997. The sample data is limited to one year for performance reasons. ???????DSum?????? ???? ?????? ??? ???????? ?????? ?? ??? ?? (???? ?? ???? ???????? ?? ???) ?? ?? ????? ?? ???? ??? ?? ????????? ?? ?????? ???? ?? ??? ?????? ?? ??? ??? ?? ????? ?? ?? ?????? ?? ????? ?? ???, ????? ????? ?? ???? ????:
  1. ????????? ????? ??????? ??????
  2. ???? ?? ?? ??? ???? ?????? ?????, ?? ???? ?????? ???????
  3. ????? ????????????? ??,???.

    ???:Access 2007 ???, ????? ??????????????????/???????? ????????????? ?? ????? ????..
  4. ?????? ?????? ????? ?? ???? ?????, ??? ????? ?????????? ??? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????,????? ????, ?????????????:
       Field: AYear: DatePart("yyyy",[OrderDate])
       Total: Group By
       Sort: Ascending
       Show: Yes
    						
    ??? ???????????????????? ????????? ???? ?? ?? ?? ???? ??? OrderDate ????? ????? ???? ????
  5. ?????? ?????? ????? ?? ????? ?????, ??? ????? ?????????? ??? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????,????? ????, ?????????????:
       Field: AMonth: DatePart("m",[OrderDate])
       Total: Group By
       Sort: Ascending
       Show: Yes
    						
    ??? ???????????????????? ????? ???? ?? ?? ???? ?????? ????? ?? ??? ?? ??? ?? ??? ??? ?? ???????? ??? 1 ?? 12 ?? ????????? ???? ???
  6. ?????? ?????? ????? ?? ????? ?????, ??? ????? ?????????? ??? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????, ????????????? ????

    ???:: ????? ?????? ???, ???? ?????? ?? ??? ??? ?? ????????? (_) ?? ???? ?? ?????? ?? ???????? ?? ??? ??? ????? ???? ???? ??? ?????? ?? ??? ?? ????????? ????? ?? ?? ?????? re-creating.
       Field: RunTot: DSum("Freight","Orders","DatePart('m', _
              [OrderDate])<=" & [AMonth] & " And  DatePart('yyyy', _
              [OrderDate])<=" & [AYear] & "")
       Total: Expression
       Show: Yes
    						
    ??? ???????????????????? ?????DSum?? AMonth ?? AYear ????? ??? ??? ?? ?? ?? ?????? ?? ??????? ???? ??? ?? ?? ??????? ??????? ?? ????? ??? Freight ????? ??? ???? ?? ??? () ????????
  7. ?????? ?????? ????? ?? ???? ?????, ??? ????? ?????????? ??? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????,????? ????, ?????????????:
       Field: FDate: Format([OrderDate],"mmm")
       Total: Group By
       Sort: Ascending
       Show: Yes
    						
    ??? ???????????????????? ?? ????? textual ??????, ??? ???? ?? Feb, ?????, ?? ??? ??? ?? ??? ????????? ???? ???
  8. ?????? ?????? ????? ?? ?????? ?????, ??? ????? ?????????? ??? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????,??????, ?????????????:
       Field: DatePart("yyyy",[OrderDate])
       Total: Where
       Criteria: 1997
       Show: No
    						
    ??? ???????????????????? ??????? recordset ?? ???? 1997 ?? ???? ???????? ???? ?? ??? ?????? ???
  9. ?????? ?????? ????? ??? ?? RunTot ????? ?? ???? ??? ?? ??? ????? ?????? ????????? ???? ??:
       AYear    AMonth     RunTot       FDate
       --------------------------------------
       1997     1          2238.98      Jan
       1997     2          3840.43      Feb
       1997     3          5729.24      Mar
       1997     4          8668.34      Apr
       1997     5          12129.74     May
       1997     6          13982.39     Jun
       1997     7          17729.29     Jul
       1997     8          22204.73     Aug
       1997     9          26565.26     Sep
       1997     10         32031.38     Oct
       1997     11         36192.09     Nov
       1997     12         42748.64     Dec
    					

???? 2

????? ???? ?? ??? ?? ??? ?????? ?? ????? ???? ?? ??DSum?? ???? ?? ?? ??? ?? ??? ????? ?? ??? () ????????

????? ????? ?????? freight ?? ??? ???? ??? ?? ???? ???? ?? ??? ??? ?? ???????? ?? ????? freight ????? ??? ???? ?? ??? ' ???? ' ?????? ?? ????? ???? ??? ?????, ?? ?????? ?????, ?? ????? ?? ???? ????:
  1. ????? ??????? Northwind.mdb ??????
  2. ???? ?? ?? ??? ???? ?????? ?????, ?? ???? ?????? ???????
  3. ????? ????????????? ??,???.

    ???:Access 2007 ???, ????? ??????????????????/???????? ????????????? ?? ????? ????..
  4. ?????? ?????? ????? ?? ???? ?????, ??? ???? ?? ??? ????? ????? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????, ?????????????:
       Field: EmpAlias: EmployeeID
       Total: Group By
       Show: Yes
    						
    ?? ????? ?? groups EmployeeID ?????? ???? ???
  5. ?????? ?????? ????? ?? ????? ?????, ??? ???? ?? ??? ????? ????? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????, ?????????????:
       Field: Freight
       Total: Sum
       Show: Yes
    						
    ?? ????? ?? ???? freight ??? ???? ???
  6. ?????? ?????? ????? ?? ????? ?????, ??? ????? ?????????? ??? ??????????????? ???, ?? ?? ??? ????? ??? ?? ???????, ????????????? ????

    ???:: ????? ?????? ???, ???? ?????? ?? ??? ??? ?? ????????? (_) ?? ???? ?? ?????? ?? ???????? ?? ??? ??? ????? ???? ???? ??? ?????? ?? ??? ?? ????????? ????? ?? ?? ?????? re-creating.
       Field: RunTot: Format(DSum("Freight","Orders","[EmployeeID]<=" _
              & [EmpAlias] & ""),"$0,000.00")
       Total: Expression
       Show: Yes
    						
    ??? ???????????????????? ????? ??DSum() ?????? Freight ????? ?? EmployeeID ???? ???? ?? ????? ???? ?? ??? ??????? EmpAlias ??, ?? ???? ??? dollars ??? ????? ?? ??????? ???? ?? ?? ??? ???? ?? ??? ???
  7. ?????? ?????? ????? ??? ?? RunTot ????? ?? ???? ??? ?? ??? ????? ?????? ????????? ???? ??:
       Employee              SumOfFreight     RunTot
       -------------------------------------------------
       Davolio, Nancy        $8,836.64        $8,836.64
       Fuller, Andrew        $8,696.41        $17,533.05
       Leverling,Janet       $10,884.74       $28,417.79
       Peacock, Margaret     $11,346.14       $39,763.93
       Buchanan, Steven      $3,918.71        $43,682.64
       Suyama, Michael       $3,780.47        $47,463.11
       King, Robert          $6,665.44        $54,128.55
       Callahan, Laura       $7,487.88        $61,616.43
       Dodsworth, Anne       $3,326.26        $64,942.69
    					

???? ???? ???? ??:
  • Microsoft Office Access 2007
  • Microsoft Office Access 2003
  • Microsoft Access 2002 Standard Edition
??????: 
kbinfo kbexpertiseinter kbhowto kbmt KB290136 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:290136  (http://support.microsoft.com/kb/290136/en-us/ )