Do not display the last character

  • Thread starter Thread starter EAB1977
  • Start date Start date
E

EAB1977

Hello. I need to create a query that will take off the last character
if it is a letter.

For example, our database has a unique identifer for each mold of
products. Well, some of these molds were duplicated by using a A, B, C,
and so on. What I need to do is see how many of these molds have a
letter at the end.

Here is my query now:

SELECT Mold0EPS.ProductCode, Mold0EPS.MoldID
FROM Mold0EPS
WHERE (((Mold0EPS.MoldID) Like "*A")) OR (((Mold0EPS.MoldID) Like
"*B")) OR (((Mold0EPS.MoldID) Like "*C"));

Is this the correct way? Or is there a better way?
 
Try the following to get the records where MoldID ends in a letter.

SELECT Mold0EPS.ProductCode, Mold0EPS.MoldID
FROM Mold0EPS
WHERE Mold0EPS.MoldID Like "*[A-Z]")
 
EAB1977 said:
Hello. I need to create a query that will take off the last character
if it is a letter.

For example, our database has a unique identifer for each mold of
products. Well, some of these molds were duplicated by using a A, B, C,
and so on. What I need to do is see how many of these molds have a
letter at the end.

Here is my query now:

SELECT Mold0EPS.ProductCode, Mold0EPS.MoldID
FROM Mold0EPS
WHERE (((Mold0EPS.MoldID) Like "*A")) OR (((Mold0EPS.MoldID) Like
"*B")) OR (((Mold0EPS.MoldID) Like "*C"));

Is this the correct way? Or is there a better way?

SELECT Mold0EPS.ProductCode, Mold0EPS.MoldID
FROM Mold0EPS
WHERE RIGHT(Mold0EPS.MoldID, 1) IN ('A', 'B', 'C')

OR

SELECT Mold0EPS.ProductCode, Mold0EPS.MoldID
FROM Mold0EPS
WHERE ISNUMERIC(RIGHT(Mold0EPS.MoldID, 1)) = FALSE
 

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

Similar Threads


Back
Top