Administrator: Receipts (Start) 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

Edit the Query

3. Recalculate the Overdue Rentals

Close any forms you might have open.

Open: rptCustomerReceiptSQ.

Save As rptCustomerReceiptByDateSQ.

 

Open rptCustomerReceiptByDateSQ in Design View.

 

The query calculations are based on:

  DaysRented: DateDiff("d",[DateRented],Now())

 

Determine the status of the movie rentals.

Create a new field with the following code:

 

   Status: IIf([DateReturned] Is Null,"Outstanding",[DateReturned])

 

In words this means: if there is no return date ( Is Null), then display the text, "Outstanding."

 

Save your changes and test the query.

Query Design Tools ->Design
 

 

  Microsoft Access 2007 Exam 77-605 Topic: 4. Creating and modifying queries 

  4.2. Modify queries   4.2.4. Create calculated fields in queries