A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

whitespace at end of data



 
 
Thread Tools Display Modes
  #1  
Old June 24th, 2008, 11:53 AM posted to microsoft.public.access.queries
jez123456
external usenet poster
 
Posts: 2
Default 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  
Old June 24th, 2008, 12:46 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 130
Default 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  
Old June 24th, 2008, 12:48 PM posted to microsoft.public.access.queries
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default 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  
Old June 24th, 2008, 12:52 PM posted to microsoft.public.access.queries
Golfinray
external usenet poster
 
Posts: 1,597
Default 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  
Old June 24th, 2008, 12:58 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.