Page 86 - AIS access_chang_ingraham
P. 86

84   CHAPTER 4 SALES/COLLECTION BUSINESS PROCESS




                                6. Close and save query as Inventory Query.


                          Queries with Multiple Values

                          A Parameter Query is one that prompts the user for the query criteria for retrieving records.
                          These criteria can be single-valued or multi-valued. In addition, the criteria can be entered
                          as absolute values or as wildcards. Assume that a company has a calendar year-end. We
                          can query for all sales greater than $650.00 between January 1, 2006 and December 31,
                          2006. We could also create the query by using wildcards for the dates. In this case, the
                          query would substitute variables such as "BeginDate" and "BSDate." In this parameter
                          query, Access then prompts the user for the appropriate values.
                                Assume that Dan Tragg wants to view his Cash Receipts for October. We can easily
                          create a query that will isolate those cash receipts.

                                1. Click on the Queries object. Click on Create query in design view. Click on the
                          Cash Receipt Table to add it to the upper part of the Query window. Hold down the Ctrl
                          key and click on the Cash Receipt Sale Table and click on Add. Close the Show Table
                          window.
                                2. Drag the CashReceiptID and the CRDate fields from the Cash Receipt Table
                          into the first two columns of the design grid. Drag the AmountApplied field from the
                          Cash Receipt Sale Table into the third column of the design grid.
                                3. Click on the Totals   icon. Pull down the menu under the Total property for the
                          CRDate. Note that there are various mathematical functions (including Sum and Average)
                          that we could choose here. However, these are not appropriate for a date field. Scroll down
                          to the bottom of the menu. The "Where" function will allow us to set the criteria for the
                          date. Change the Total property for the CRDate field to "Where."
                                4. In the Criteria property of the CRDate field, type Between [BeginDate] and
                          [EndDate].




                                                                                                      bJ[gl~
                          I~ Q.uery1 : Select Q.uery
                                Cash Recei...  Cash Recei... \.                                             f.
                                .             .                                                             t..,.;;
                                       ~
                                              CllsIlReceipllD
                                CllshReceiptil  .1  ~ -
                                CRDllte
                                CustomerChec ~  AmountApplied
                                CustomerID  lU                                                             ,R
                           tTIJ                                                                           m
                              Reid:  CashReceiptlD  CROate           AmountApplied                         ~
                              Table:  Cllsh ReceiplTable  Cash Receipt Table  Cash Receipt Sale Table      L-
                              Total: Group By  Where              Iv Group By
                               Sort:
                              Show:    ..tI             r1                 V
                             Crlterta:        Between [BeglnOate) And [EndOate)  -  -
                                or:                                                                   -I>lF
                                  I<Fl
                          FIGURE 4-42



                                5. Click on the Run ! icon.

                                6. Type 10/1/2006 in the prompt for the BeginDate. Click OK.
   81   82   83   84   85   86   87   88   89   90   91