Query Help?

  • Thread starter Peakey via AccessMonster.com
  • Start date
P

Peakey via AccessMonster.com

New to access so please bear with me.

I have a table used for the pricing of window blinds, to obtain a price we
need the width x drop. so i created a table with fields named drop, 610,914,
1219,1524 etc etc.

The drop field I enter the drop measurements again 610,914,1219,1524 etc etc,
the other field measurement make up the table column heads,I then put the
relevant prices in these fields.

e.q
ID Drop 610 914 1219 1524
Width
1 610 12.60 17.10 20.70 25.20
2 914 15.30 19.80 22.50 27.90
3 1219 18.00 21.60 26.10 30.60
4 1524 19.80 23.40 27.90 32.40

Question
How would i construct a query to obtain the price field for any size window
blind? say 1250 width x 940 drop, if a window blind measurment is larger than
the sizes above than it should return the next price up. i.e 1250w x 940drop
would obtain the price from 1524w x 1219drop which would be 30.60.

Hope this all makes sense.

Regards Peakey.
 
A

Allen Browne

The table you built is a spreadsheet design.
In a relational databse, you need to use a table with fields like this:
BlindID AutoNumber
BlindDrop Number
BlindWidth Number
PriceEach Currency

If you want to print a price list that looks like the example you gave, use
a crosstab query.

Now to look up the price, see Tom Ellision's article:
Lookup in a range of values in a query
at:
http://allenbrowne.com/ser-58.html
Tom's example show only one dimension but you can use the same principle for
2.
 
Top