Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get only names from table

Status
Not open for further replies.

psaaccess

Programmer
Apr 14, 2008
18
My data is lastname firstname 1200-1500 and some of the records lastname and firstname only. I want to get only lastname and firstname without numbers

Ex: 1record.abcd xyz 1200-1500
result is only: abcd xyz
2 record.abcd xyz

Please help me.
 
What is the 1record.? What do you want to do with the split information, just display it or store it back into fields in your table?

Do you have a field name to share?

You can use these string functions:
Left()
Mid()
Instr()
Split()
or roll your own function with these.

Have you made any attempts yet?

Duane
Hook'D on Access
MS Access MVP
 
Hi dhookom,
I used left() and instr() in query. It is not getting whole name.
The field name is workername.



 
Please post your SQL and a sample of the data as it appears in the table. It is almost impossible to figure out what the issue or the problem is from a statement like

It is not getting whole name.
 
If the numbers are always "1200-1500" then could you not do a simple Replace() (with a Trim() around it)?

Something like:
Code:
SELECT Trim(Replace([workername],"1200-1500","")) AS NamesNotNumbers
FROM tbl_Worker;
Hope this helps

Andy
---------------------------------
Zebracorn: 50% Zebra, 50% Unicorn = 100% Real.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top