range expression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I have 2 tables:

Table 1 has data: from to kgs
london cardiff 14

Table 2 has carrier rates table: 100 200 500 minimum et
.20 .18 .15 4

I need an expression that evaluates lon to card 145 and multiplies by .18 and gives me the answer, but if it doesn't equal or exceed the minimum......= minimum

any ideas

Al
 
Try something along the lines of
SELECT T1.kgs * T2.rate
FROM [Table 1] T1, [Table 2] T2
WHERE T2.minimumWeight IN (SELECT Min(minimumWeight) FROM
[Table 2] T3 WHERE T1.kgs <= T3.minimumWeight)

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Hi all,

I have 2 tables:

Table 1 has data: from to kgs
london cardiff 145

Table 2 has carrier rates table: 100 200 500 minimum etc
..20 .18 .15 42
I need an expression that evaluates lon to card 145 and
multiplies by .18 and gives me the answer, but if it
doesn't equal or exceed the minimum......= minimum.
 
Back
Top