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

Large gap in Concatenate 2

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi,
I keep getting a large gap between the names that I am concatenating like "John Smith" (In access and excel) I tried looking this up but had no luck. Is there a solution to this. Thanks.
 
Have a look at the Trim function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

I didn't know "If trim" could be used in queries but I had a go and got "wrong number of arguments message".

EmployeeName: IIf(trim([surname] & "" & [forename]))

I think it's looking for a "then" but I got an Syntax message with that.

I'm sure this a pretty poor effort but I haven't seen this done before.
 
EmployeeName:Trim([surname]) & " " & Trim([forename])

The trim just removes spaces - no need for the Iif

Let them hate - so long as they fear... Lucius Accius
 
If I had just left out the "IIf" it would have worked, DOH!


EmployeeName: Trim([surname]) & " " & ([forename])


Thanks Stray and PHV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top