If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
whitespace at end of data
Hi Experts
I have a table with the following user_names "Bill" "Fred" "Andrew" "Fred " As you can see, there are 2 Freds (one without a space at the end, and one with a space at the end). How do I select one and not the other? |
#2
|
|||
|
|||
whitespace at end of data
On Jun 24, 12:53*pm, jez123456
wrote: Hi Experts I have a table with the following user_names "Bill" "Fred" "Andrew" "Fred " As you can see, there are 2 Freds (one without a space at the end, and one with a space at the end). How do I select one and not the other? Hello, Question: are you sure second "Fred" has space after its name? Can you open table and check that? Regards, Branislav Mihaljev Microsoft Access MVP |
#3
|
|||
|
|||
whitespace at end of data
Does Fred have a last name or an ID? Combine the two fields to get the
correct Fred. Bonnie http://www.dataplus-svc.com jez123456 wrote: Hi Experts I have a table with the following user_names "Bill" "Fred" "Andrew" "Fred " As you can see, there are 2 Freds (one without a space at the end, and one with a space at the end). How do I select one and not the other? -- Message posted via http://www.accessmonster.com |
#4
|
|||
|
|||
whitespace at end of data
You could use Like "fred" or Like "fred " in the criteria line of the field.
"jez123456" wrote: Hi Experts I have a table with the following user_names "Bill" "Fred" "Andrew" "Fred " As you can see, there are 2 Freds (one without a space at the end, and one with a space at the end). How do I select one and not the other? |
#5
|
|||
|
|||
whitespace at end of data
In most cases, Access will strip out any trailing spaces when it stores the
data. IT is possible to get trailing spaces if the data is input via other means then the keyboard and it is possible to have trailing spaces if you are linking to other data sources - Excel, MS SQL server, etc. Are you trying to find names that end in one (or more spaces)? Field: User_Names Criteria: Like "* " With No space at the end Field: User_Names Criteria: NOT Like "* " Or even Field: User_Names Criteria: Like "*[! ]" Or Field: Right(User_Names,1) Criteria: = " " John Spencer Access MVP 2002-2005, 2007-2008 Center for Health Program Development and Management University of Maryland Baltimore County jez123456 wrote: Hi Experts I have a table with the following user_names "Bill" "Fred" "Andrew" "Fred " As you can see, there are 2 Freds (one without a space at the end, and one with a space at the end). How do I select one and not the other? |
Thread Tools | |
Display Modes | |
|
|