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

Concat two fields without losing the trailing spaces in 1st field 1

Status
Not open for further replies.

Laura2

IS-IT--Management
Aug 13, 2002
99
US
How do I concatenate two fields whereas the first field is 5 digits and the 2nd field is 12. The problem I'm having is that sometimes the first field is only 4 characters and I need to include the space in my concatenation. Not all of the records are 4 digits though so I need the statement to work on either. What it's doing is chopping off the space in the first field and continueing on with the 2nd field entry. That won't work. Any help you can provide is greatly appreciated:

SELECT [NWD0315]![Model] & [NWD0315]![Serial] AS concat, NWD0315.[Sale Type]
FROM NWD0315;

Thank you,

Laura
 
SELECT Left([Model] & ' ', 5) & [Serial] AS concat, [Sale Type]
FROM NWD0315

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You're a genius!!! Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top