Query Help Please

R

ramcharger88

Hi Everyone,

Maybe someone can help me out. First let me thank every one in
advance.

I need to make a query to out put the following

in table "A" I have a field "Distance" this field contains a range of
numbers from 0 -100

I want my query to give me this output and assign each group a value I
specifies in a new table

(The make table and stuff like that I can do)

lets say:

Distance Assigned value

0-25 a

26-40 b

41-50 c

51-75 d

75-100 e

I got a query to work that if I put <25 the data under 25 would be
assign 0 and over 25 was assign -1

that helped a little bit.

If any one can help I truly thank you

Tom
 
M

Michel Walsh

Have a tables, DistancesCodes, three fields, like:

MinDist, UpToDist, Assign ' fields
0 25 a
25 40 b
40 50 c
50 75 d
75 100 e ' data



Then, open a new query, bring your initial table and also bring the table
DistancesCodes.

In the grid, drag the fields you want to see, that include the field
DistancesCodes.Assign.

Next, bring in the grid the 'distance' field, in two different columns.
Under the first column, at the criteria line, type:
= [DistancesCodes].MinDist


and, under the second colum (for the distance fields you added twice), have
the criteria:

< [DistancesCodes].UpToDist


That's all.




Hoping it may help,
Vanderghast, Access MVP
 
R

ramcharger88

Have a tables, DistancesCodes, three fields, like:

MinDist,    UpToDist,       Assign        ' fields
0                25                    a
25              40                    b
40              50                    c
50              75                    d
75            100                    e               ' data

Then, open a new query, bring your initial table and also bring the table
DistancesCodes.

In the grid, drag the fields you want to see, that include the field
DistancesCodes.Assign.

Next, bring in the grid the 'distance' field, in two different columns.
Under the first column, at the criteria line, type:

    >= [DistancesCodes].MinDist

and, under the second colum (for the distance fields you added twice), have
the criteria:

    < [DistancesCodes].UpToDist

That's all.

Hoping it may help,
Vanderghast, Access MVP




Hi Everyone,
Maybe someone can help me out. First let me thank every one in
advance.
I need to make a query to out put the following
in table "A"  I have a field "Distance" this field contains a range of
numbers from 0 -100
I want my query to give me this output and assign each group a value I
specifies in a new table
(The make table and stuff like that I can do)
lets say:
Distance Assigned value
0-25             a
26-40           b
41-50           c
51-75           d
75-100         e
I got a query to work that if I put <25 the data under 25 would be
assign 0 and over 25 was assign -1
that helped a little bit.
If any one can help I truly thank you
Tom- Hide quoted text -

- Show quoted text -

Thank You worked great
Tom
 

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