Kamis, 01 Mei 2014

RE: [MS_AccessPros] Displaying a part of a string from a field

 

Art,
 
You can use Instr() and Mid() functions.
 
Instr() will find the first occurance of one string inside another. You should be able to find the first occurance of the space between the first and last names.
 
Mid([Searched string], [Find Me]) will return a subset of characters in a string beginning at a specific place. 
 
Instr("This is a test","is") = 3
Instr("This is a test"," ") = 5
Mid("This is a test", 3) = "is is a test"
Mid("This is a test", 3,5) ="is is"
 
You can combine like:
Mid("This is a test", Instr("This is a test","is")) = "is is a test"
 
That should be all you need to know to figure out how to substitute in your field names.
 
Duane Hookom MVP
MS Access
 

From: dbalorenzini@yahoo.com
I have a table with a field call CustomerName:

Joe Blow
Jane Doe
Mark Smith

What I need is to view the last name by itself but I am not sure how to do it.

Select CustomerName from Customer.
Any Ideas?

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

Now you can search Photos & Files in your Group !
You can now search not only your archive of conversations, but also photos and files stored in your Yahoo Group. Give it a try!

.

__,_._,___

Tidak ada komentar:

Posting Komentar