Solved

to get In a Query Similar fields in access 2010

Posted on 2011-03-05
5
328 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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 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