help

Access_help_rob

Registered User.
Local time
Today, 15:36
Joined
Jul 3, 2003
Messages
66
I am looking for help in trimming off some characters from a field name, say the last 3 characters. i wonderd if there was fucntion built into access which would enable me to do this in a query.
any help is appeciated
thanks
rob
 
How many times are you going to keep asking the same question with different wordings?

First Time

Second Time

Third Time

For basic text handling, lookup these functions:

Mid()
Left()
Right()
InStr()
Len()


You can use them (as with all functions) in VBA, in Queries, in Code, on Forms, in Reports, and with Macros.
 
Mile-O-Phile has it right on the money. In your query, you need to create a new field and add one of the (or combination of) the functions he listed.

Say you have a field FName, but when you import the data it looks like 123Jeremie, 321Bob, 409Janet. You just want the name itself and not the numbers. Use the query builder and add the tbl that contains the data. In the top row of the column you would add this (under the assumption the field name is FName and the new filed you create is called RegName)

RegName: Right([FName],(Len([FName])-3))

You could easily create this function by using the BUILD option and making the selections from the built in functions. What this string is doing is...
RegName: - creating the new field within the query
Right ( - telling it to return everything within a certain range starting from the right.
[FName], - this is the filed you want to look in
(Len([FName]) - returns the total number of characters in the field.
-3 - subtracts 3 from the total number of characters.
 

Users who are viewing this thread

Back
Top Bottom