query - plssss help

R

rekha

Hello!

I have a table that has rates based on weights of goods, which is
catagorized as rate1, rate2...rate6, based on weight codes which are
1,2,3,4,5,6.

I want to accept a number ranging from 1 to 6 from the user, who should have
an option to enter his choice of weight every time the query runs and get
rates pertaining to that record (corresponding to that weight only.)

pls help me - how do you accept a choice from user.
also how do you select records based on the weight code, which extracts only
the corresponding rate.

Thanks so much in advance

Rekha
 
J

James B

pls help me - how do you accept a choice from user.
this is a webdev question, not sql, an html form is an
easy solution, search for form tutorials on google.
also how do you select records based on the weight code, which extracts only
the corresponding rate.
view the beginner tutorials at w3schools.com, to select a
value you would do "SELECT rate FROM tbl WHERE weight=5;"
for example.
 
J

John Vinson

Hello!

I have a table that has rates based on weights of goods, which is
catagorized as rate1, rate2...rate6, based on weight codes which are
1,2,3,4,5,6.

Let me get this straight - do you have *SIX FIELDS* named rate1 to
rate6? If so, your table structure is improperly normalized. You're
embedding a one-to-many relationship in each record, instead of
correctly having a one-to-many relationship to a Rates table.
I want to accept a number ranging from 1 to 6 from the user, who should have
an option to enter his choice of weight every time the query runs and get
rates pertaining to that record (corresponding to that weight only.)

pls help me - how do you accept a choice from user.

With a Parameter query.
also how do you select records based on the weight code, which extracts only
the corresponding rate.

With a fair bit of difficulty in your current table structure; with a
simple parameter if you have the structure correctly normalized. With
your current design, as I understand it, you would need a monstrous
Choose() function:

Rate: Choose([Enter weight code, 1 to 6:], [rate1], [rate2], [rate3],
[rate4], [rate5], [rate6])


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
R

rekha

Hello John,

Thanks so much for the suggestion. The Value () works perfect!

Would you be so kind to explain: How do I get the tables normalized, I am
pretty new to access,,all self taught work.

Thanks in advance.

John Vinson said:
Hello!

I have a table that has rates based on weights of goods, which is
catagorized as rate1, rate2...rate6, based on weight codes which are
1,2,3,4,5,6.

Let me get this straight - do you have *SIX FIELDS* named rate1 to
rate6? If so, your table structure is improperly normalized. You're
embedding a one-to-many relationship in each record, instead of
correctly having a one-to-many relationship to a Rates table.
I want to accept a number ranging from 1 to 6 from the user, who should have
an option to enter his choice of weight every time the query runs and get
rates pertaining to that record (corresponding to that weight only.)

pls help me - how do you accept a choice from user.

With a Parameter query.
also how do you select records based on the weight code, which extracts only
the corresponding rate.

With a fair bit of difficulty in your current table structure; with a
simple parameter if you have the structure correctly normalized. With
your current design, as I understand it, you would need a monstrous
Choose() function:

Rate: Choose([Enter weight code, 1 to 6:], [rate1], [rate2], [rate3],
[rate4], [rate5], [rate6])


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top