Help needed with expression

Sausagefingers

Registered User.
Local time
Today, 20:18
Joined
Dec 14, 2006
Messages
51
Hi,
I have a problem I'm trying to solve using an expression in a query

So far I have a working expression giving me the result I want.
Simply it's:

subtotal: ([ChargeA])+([ChargeB])+([ChargeC]) etc. etc.

However, I also have to apply an effective 'Cap' which I'm calling a 'Full Load Charge'.

Whenever a subtotal exceeds the full load charge I need to cap it so that our customer doesn't get over-charged. This full load charge is agreed with our customers.

Let's say for example that the subtotal for hauling goods from a supplier is £600 for a total of 20 pallets but the Full Load Charge has been agreed at £400.

How can I build an expression that will use the subtotal calculated until it reaches the full load charge limit and then use the agreed full load charge?

The expression might read something like... 'fullLoadChgCap: If 'subTotal' is less than or equal to 'fullLoadCharge' use 'subTotal' else use 'fullLoadCharge'

I don't know how to write this as an expression :o .

Thanks in advance
 
Try something ike this

fullLoadChgCap: Iif([subTotal] <= [fullLoadCharge],[subTotal],[fullLoadCharge])
 
Last edited:
Thanks...works like a treat.

Doh! I knew I should have had the guts to write what I was thinking in the first place.

Sausagefingers repeats this line one thousand times...
I must have more faith in my own abilities
I must have more faith in my own abilities
I must have more faith in my own abilities
.....
 

Users who are viewing this thread

Back
Top Bottom