PC Review


Reply
Thread Tools Rate Thread

Display data without leading spaces

 
 
=?Utf-8?B?U2NvdHQ=?=
Guest
Posts: n/a
 
      1st Jun 2007
I have two fields, one is the customer code and the other is the product
code. Both fields are text fields with a field size of 12. The data in the
fields have leading spaces with data values from 1 to 999999 so there are
from 11 to six leading spaces. How do I format the fields on a query or
report to display the values without the leading spaces?

Thanks,

Scott
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      1st Jun 2007
Use the Trim function:

SELECT Trim(Field1) From MyTable

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Scott" <(E-Mail Removed)> wrote in message
news:6E9FE3DA-7F5C-4D4E-AF15-(E-Mail Removed)...
>I have two fields, one is the customer code and the other is the product
> code. Both fields are text fields with a field size of 12. The data in
> the
> fields have leading spaces with data values from 1 to 999999 so there are
> from 11 to six leading spaces. How do I format the fields on a query or
> report to display the values without the leading spaces?
>
> Thanks,
>
> Scott



 
Reply With Quote
 
Jason Lepack
Guest
Posts: n/a
 
      1st Jun 2007
Scott,

Use the trim() function.

SELECT
Trim(your_field_with_the_spaces)
FROM
you_table

Cheers,
Jason Lepack

On Jun 1, 4:27 pm, Scott <S...@discussions.microsoft.com> wrote:
> I have two fields, one is the customer code and the other is the product
> code. Both fields are text fields with a field size of 12. The data in the
> fields have leading spaces with data values from 1 to 999999 so there are
> from 11 to six leading spaces. How do I format the fields on a query or
> report to display the values without the leading spaces?
>
> Thanks,
>
> Scott



 
Reply With Quote
 
=?Utf-8?B?U2NvdHQ=?=
Guest
Posts: n/a
 
      4th Jun 2007
Worked great! Thank you -

"Douglas J. Steele" wrote:

> Use the Trim function:
>
> SELECT Trim(Field1) From MyTable
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Scott" <(E-Mail Removed)> wrote in message
> news:6E9FE3DA-7F5C-4D4E-AF15-(E-Mail Removed)...
> >I have two fields, one is the customer code and the other is the product
> > code. Both fields are text fields with a field size of 12. The data in
> > the
> > fields have leading spaces with data values from 1 to 999999 so there are
> > from 11 to six leading spaces. How do I format the fields on a query or
> > report to display the values without the leading spaces?
> >
> > Thanks,
> >
> > Scott

>
>
>

 
Reply With Quote
 
=?Utf-8?B?U2NvdHQ=?=
Guest
Posts: n/a
 
      4th Jun 2007
Thank you!

"Jason Lepack" wrote:

> Scott,
>
> Use the trim() function.
>
> SELECT
> Trim(your_field_with_the_spaces)
> FROM
> you_table
>
> Cheers,
> Jason Lepack
>
> On Jun 1, 4:27 pm, Scott <S...@discussions.microsoft.com> wrote:
> > I have two fields, one is the customer code and the other is the product
> > code. Both fields are text fields with a field size of 12. The data in the
> > fields have leading spaces with data values from 1 to 999999 so there are
> > from 11 to six leading spaces. How do I format the fields on a query or
> > report to display the values without the leading spaces?
> >
> > Thanks,
> >
> > Scott

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace leading zeros with leading spaces ? Gary Microsoft Excel Programming 4 7th Jan 2010 11:39 AM
how do I remove leading spaces and leave the remianing spaces w =?Utf-8?B?RGViaQ==?= Microsoft Excel Worksheet Functions 6 28th Feb 2007 03:29 PM
How do I add leading spaces to a value? =?Utf-8?B?Q2hyaXMgIEJyb3du?= Microsoft Excel Worksheet Functions 5 3rd Mar 2006 05:32 PM
How to display leading zeroes e.g. 000123 as data entry in Excel? =?Utf-8?B?VG9ueSBQYWxpbmQ=?= Microsoft Excel Misc 3 23rd Nov 2004 12:03 PM
Excel Truncating Leading Spaces when pasting data Wayne Microsoft Excel Misc 1 21st Apr 2004 09:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:26 PM.