Need part of a name chopped!!

rmason

Registered User.
Local time
Today, 12:25
Joined
Aug 7, 2003
Messages
27
Hi,
In my database I have a field called "Department". The data comes from our Meditech system and is imported as: PCU-EXP
OR-EXP
EMERGENCY-EXP
ETC....

Once the data is in the Access table, How can I remove the -EXP from the department names?? This will cause a problem when the user of the database needs to add a department or needs to search. Please help!!
 
Left$(MyField,len(trim$(MyField))-4)

That will remove the last 4 charcters from the field.
 
Thanks Rich

RichO said:
Left$(MyField,len(trim$(MyField))-4)

That will remove the last 4 charcters from the field.
Thanks Rich, I will try it now!! Thanks
 
I'd have used the InStr() function.

Code:
Left([MyField], InStr(1, [MyField], "-EXP") - 1)
 
Dumb Question but..........

Do these formulas go in the query criteria?? I tried both ideas and neith worked....Sorry. Any ideas?? Thanks again. Rick
 
Not criteria.

You form a new field with them:

i.e.

MyNewField: Left([MyOldField], InStr(1, [MyOldField], "-EXP") - 1)
 

Users who are viewing this thread

Back
Top Bottom