Datediff and IIF function in form.

Metalman5

New member
Local time
Today, 08:50
Joined
Jan 21, 2014
Messages
2
Hi there, I have just joined the forum. Im currently studying computers at college and im having trouble with something in my database. If you guys could help me it would be a big weight of my shoulders.

Basically my database is for a library based on borrowing/returning books ect

Everything works except this one thing, in one of my forms I can ask the user to input a book number of the book they want to check if it has been returned or not, if it hasnt been returned within 30 days then it will come up with overdue.

The statement im trying to use i cant get it to work.

=IIf([DateDiff("d",[Borrow Date],Now()>30)

I want it to display overdue if the book isnt returned in 30 days of the borrow date.

If anyone has any suggestions it would be great

thanks alot.
 
Your formula is incomplete. Try

=IIf(DateDiff("d",[Borrow Date],Now())>30,"Overdue", "")
 
Hi thanks for the quick reply.

I have tested it on some of my book borrows ones that are overdue a year and ones that are not overdue and it seems to be working.

I was really struggling with this.

Thanks alot for your help !
 
Happy to help, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom