how can I extract one character from field content

  • Thread starter Thread starter W@M
  • Start date Start date
W

W@M

Hi,

I have a field which contains 2 or 4 numeric characters and 1 alphabetical
character, like this:

Field1:

0103C
0103D
0103E
18A
18B
18W
etc.

I want to extract the alphabetical character and place this in another field
(new colomn), like this:

Field1: Field2:
0103C C
0103D D
18A A
18B B
18W W
ect. etc.

How can I do this? There's only 1 alphabetical character in each field and
it's always the last character of the fieldcontent.

TIA

Willem
 
This will return the last character in a select query.

Right([Field1],1) AS Field2

Add the new field in the table. Next use something like above to update the
data in the new field using an Update query.
 
Hi Rick,

When I put this in a query I get an error: missing operand or something like
that; what am I doing wrong?

Regards,

Willem


Rick B said:
Field2: Right([Field1],1)

--
Rick B



W@M said:
Hi,

I have a field which contains 2 or 4 numeric characters and 1
alphabetical character, like this:

Field1:

0103C
0103D
0103E
18A
18B
18W
etc.

I want to extract the alphabetical character and place this in another
field (new colomn), like this:

Field1: Field2:
0103C C
0103D D
18A A
18B B
18W W
ect. etc.

How can I do this? There's only 1 alphabetical character in each field
and it's always the last character of the fieldcontent.

TIA

Willem
 
Hi Jerry (and Rick),

Thanks: "update query" was the magic word.
I used this: UPDATE Tabel1 SET Tabel1.Field2 = Right([Tabel1.Field1],1);
Works fine!

Thanks again,

Willem


Jerry Whittle said:
This will return the last character in a select query.

Right([Field1],1) AS Field2

Add the new field in the table. Next use something like above to update
the
data in the new field using an Update query.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


W@M said:
Hi,

I have a field which contains 2 or 4 numeric characters and 1
alphabetical
character, like this:

Field1:

0103C
0103D
0103E
18A
18B
18W
etc.

I want to extract the alphabetical character and place this in another
field
(new colomn), like this:

Field1: Field2:
0103C C
0103D D
18A A
18B B
18W W
ect. etc.

How can I do this? There's only 1 alphabetical character in each field
and
it's always the last character of the fieldcontent.

TIA

Willem
 
But, why are you storing it in your table? That is redundant if you have it
in both fields.

--
Rick B



W@M said:
Hi Jerry (and Rick),

Thanks: "update query" was the magic word.
I used this: UPDATE Tabel1 SET Tabel1.Field2 = Right([Tabel1.Field1],1);
Works fine!

Thanks again,

Willem


Jerry Whittle said:
This will return the last character in a select query.

Right([Field1],1) AS Field2

Add the new field in the table. Next use something like above to update
the
data in the new field using an Update query.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


W@M said:
Hi,

I have a field which contains 2 or 4 numeric characters and 1
alphabetical
character, like this:

Field1:

0103C
0103D
0103E
18A
18B
18W
etc.

I want to extract the alphabetical character and place this in another
field
(new colomn), like this:

Field1: Field2:
0103C C
0103D D
18A A
18B B
18W W
ect. etc.

How can I do this? There's only 1 alphabetical character in each field
and
it's always the last character of the fieldcontent.

TIA

Willem
 

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

Back
Top