Re: Using criteria in select query for recoding of variables
- From: Peter <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Jul 2006 20:14:01 -0700
--
Peter
"Michel Walsh" wrote:
Hi,
Not sure I understand fully the problem. Is it a kind of "lookup" ? if so,
have a table that list the translations to be preformed:
Old ToBe ' fields name
1 A
2 A
3 B
4 C
5 C
and then, either a join, either a DLookup would do:
myNewValue = DLookup("ToBe", "tableNameHere", "Old=" & myOldValue )
Hoping it may help,
Vanderghast, Access MVP
"Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CF982982-1433-4D40-A634-97029B4F9EC6@xxxxxxxxxxxxxxxx
I am a very new user. I want to code the values of a new variable based on
the values of an old variable. For example 1 and 2 in old variable become
A
in new variable; 3 becomes B in the same new variable; and the value 4 and
5
in the old variable becomes C in the new variable.
--
Peter
Hey thanks Michel, I reallly appreciate your time.
You interpreted my question correctly and your suggestion will be very
useful. I will try it as a means of learning about lookup applications.
My purpose also is to learn about using criteria and expressions in the
query grid. So, could you please think about another solution that is based
on using the criteria line to achieve the same outcome. I think if you
created something for me in sql that Ii could just cut and paste and adapt
the code for running on my table. It will be my first time using a sql
statement! (I have got the gist of doing the pasting in from other
conversations i have looked at in this discussion group.)
Could you pls make the code as clear as possible and using the professional
layout conventions so i can see how it should be written right from the start
of my learning about sql.
Imagine the table just has the field "old" as you have conjectured and with
the values you have put in. Say there is no other lookup table. The new
field would be the one you suggested, "feildsname". This would be creasted
in an expression. And then the values of the "fieldsname" variable would end
up as per your "Tobe" field above. In other words your Tobe field is exactly
how i want the calculated field to contain.
And lastly, could you recommend a good clear book for idiots to show me how
to write sql code.
Thanks very much. Looking forward to hearing back.
.
- Follow-Ups:
- Re: Using criteria in select query for recoding of variables
- From: Michel Walsh
- Re: Using criteria in select query for recoding of variables
- References:
- Re: Using criteria in select query for recoding of variables
- From: Michel Walsh
- Re: Using criteria in select query for recoding of variables
- Prev by Date: Re: Startup Popup
- Next by Date: Re: A Complicated Query
- Previous by thread: Re: Using criteria in select query for recoding of variables
- Next by thread: Re: Using criteria in select query for recoding of variables
- Index(es):
Relevant Pages
|
Loading