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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name and Patient number, how to seperate 1

Status
Not open for further replies.

din2005

Programmer
Mar 22, 2005
162
GB
Hi all

I have this table which has the patients name and there number for e.g
Joe Bloggs dv2054
Clark Kent dd2333
how would I in a query retrieve the patient number (dv2054, dd2333), is there a criteria i could use

thanks
 
You may try to play with the InStrRev function (in the query grid):
Patient#: Mid([name field], 1+InStrRev([name field],' '))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If the patient number is has a fixed lenght (say 6)
then try this update querry

Code:
Update YourTable Set TheField1=left([TheField],len([TheField])-6), TheField2=right([TheField],6)
where TheField holds the patients name and there number, TheField1 shall hold the name and TheField2 the patient number. Add those last 2 fields to YourTable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top