Conditional statement in a query expression.

gallagher

New member
Local time
Today, 14:56
Joined
Apr 9, 2001
Messages
5
Hi

I am trying to calculate a percentage amount based on a "Either/OR" condition.

The application is to give customers a percentage discount if their service is not working for a certain length of time. Example: If the time is > 6hrs AND < 36hrs then calculate 10% of the Monthly Bill and return this value, if > than 36hrs then calculate 15% of the Monthly Bill and return value. How does one do this in a query or report?

Regards
Darren

Thanks a lot, that worked fine.

[This message has been edited by gallagher (edited 01-21-2002).]
 
Consider using the Switch() function in a calculated field in a query.
If, for example, you had fields [DownTime] and [TotBill] you could use something such as this.
Switch() works similar to Case Select in that it moves through the various options, selecting the first True statement.

Discount = Switch(DownTime>36, TotBill * 0.15, DownTime >= 6, TotBill * 0.10, True, 0)
 

Users who are viewing this thread

Back
Top Bottom