Solved

to get In a Query Similar fields in access 2010

Posted on 2011-03-05
5
323 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
  • 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 250 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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Read about achieving the basic levels of HRIS security in the workplace.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

914 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now