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

Calculate the DateDiff()

How do you calculate the overdue movies?

If there is no return date, then what is the difference from the rental date and today’s date?

 

If there is a return date, is it greater than the 1, 2, or 3-day rental?

 

Edit this code in your query.

Determine if it calculates correctly, please.

 

Overdue: IIf(Left([Description],1)-DateDiff("d",[DateRented],Now())>DateDiff("d",[DateRented],Now()),"Not Overdue","Overdue")

 

In words this means:

The number of days since they rented the movies:

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

 

The number of days allowed in the rental:

Left([Description],1)

 

If the difference is greater than the number of days allowed, then the movie is Overdue.

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