Solved

to get In a Query Similar fields in access 2010

Posted on 2011-03-05
5
322 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

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Please show sample data example rows with the *desired* results ....  IE ... Before and After.

mx
0
 

Author Comment

by:bill201
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
databasemx

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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
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…

771 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

10 Experts available now in Live!

Get 1:1 Help Now