Administrator: Receipts Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

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