Access 97 Report

B

Bill

How can I enter into an amount field, the following
formula:Is it possible to do this?
If MDate < Date() then AmountDue=(Balance+IDue) else
AmountDue=((((Date()-NDue)/30.416)+1)*PAmount)
 
F

Fons Ponsioen

The way I would do that is, in an unbound textbox enter
the following formula:
=IIf([MDate] < Date(),([Balance]+[IDue]),((((Date()-
NDue)/30.416)+1)*PAmount))
all on one line and make sure the commas are as indicated
and that you have the data elements in the undelying table
or query.
The basics of the IIF statement are:
IIF( condition, result for true, result for false)
Hope this helps
 
F

fredg

How can I enter into an amount field, the following
formula:Is it possible to do this?
If MDate < Date() then AmountDue=(Balance+IDue) else
AmountDue=((((Date()-NDue)/30.416)+1)*PAmount)

I assume [NDue] is a date datatype and I think you wish to divide the
number of days between the current date (Date()) and [NDue] by 30.416,
add 1 then multiply that amount by [PAmount].

Add an UNBOUND control to the report.
Set it's Control Source to:

=IIf([MDate]<Date(),[Balance] + [IDue],
DateDiff("d",Date(),[NDue])/30.416)+1)* [PAmount])

Do you rally mean to use < Date().
Perhaps you mean <= Date()?
 
Top