Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

to get In a Query Similar fields in access 2010

Posted on 2011-03-05
5
Medium Priority
?
335 Views
Last Modified: 2012-05-11
i have in a table customert customer with similar names like this

jimmy
jimmy/sample

with other works i have the same name with addition of Backslash and few characters
and i want to make a query that will give me by column one in the query result a customer name and by column 2 to get the similar name with a backslash
please give a sql statement to get this result
0
Comment
Question by:bill201
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 75
ID: 35044614
Please show sample data example rows with the *desired* results ....  IE ... Before and After.

mx
0
 

Author Comment

by:bill201
ID: 35044635
very simple

in the database that i have upload iits has a table with the name customert and i want to create a select query (not update)
to see in the first column jimmy and in the second coulumn jimmy/dfdf
etc..

upload59.zip
0
 
LVL 6

Accepted Solution

by:
TinTombStone earned 1000 total points
ID: 35044649
Assuming your table is called Customer and the field is named Name then the following gives you a few alternatives

SELECT customer.NAME, Left([name],InStr([name],"/")-1) AS LeftSide, Right([name],Len([name])-InStr([name],"/")) AS RightSide, Left([name],InStr([name],"/")) AS [LeftSideWith/], Right([name],Len([name])-InStr([name],"/")+1) AS [RightSideWith/]
FROM customer;
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1000 total points
ID: 35044672
How about this:

SELECT CustomerT.CustomerID, IIf(InStr(1,[CustomerName],"/")>0,Left([CustomerName],InStr(1,[CustomerName],"/")-1),[CustomerName]) AS Expr1, CustomerT.CustomerName
FROM CustomerT;

mx
0
 

Author Comment

by:bill201
ID: 35045010
databasemx

how i can to get the customerid from the name that is in expr1?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question