Expression error

faizulhu

Registered User.
Local time
Today, 20:35
Joined
Oct 30, 2006
Messages
15
I am trying to create a expression to calculate the net fine of a book by the expression below by using a query:

Net Fine: IIf(DateDiff("d",[Issue Date],Date())>7 And [Returned]=True,(DateDiff("d",[Issue Date],Date())-7)*15,"0")

The returned field is a checkbox. The expression works but the record keeps updating and as a result the net fine increases everyday. So is there any way to keep the fine from increasing. I know then problem is occuring due to the usage of Date(). And I dont want use VB for this task.
And is there any way to set its data type to currency.
 
book

You could use a returneddate field and use that instead of Date(). Set your default value of returneddate to Date(). That way the net fine never increases.

If the book is never returned the net fine field will not exist in that IIF statement.

Hope this helps.

I did not see the double posting. Sorry about that.
 

Users who are viewing this thread

Back
Top Bottom