PC Review


Reply
Thread Tools Rate Thread

Access project - need to trim fields

 
 
Mick Ruthven
Guest
Posts: n/a
 
      27th Jan 2006
This is my first Access project to develop, so I'm learning the ropes of
dealing with SQL Server. One thing that cropped up is that the fields seems
to be filled with training blanks. On forms that's only "strange" and an
inconvenience, but on reports it can force extra rows for "can grow" fields.
I solved the problem by doing an rtrim() on all the fields in a query before
using them in forms and reports. Is that a known issue and is there a
better/easier way to handle it?

Thanks,

Mick Ruthven


 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      27th Jan 2006
Mick

I suspect you are running into an issue with the data type in SQL Server.
If the data field/column were defined with "varchar" (variable length,
character type), you shouldn't be seeing trailing blanks.

You might find that the data fields are defined as char (character), with a
fixed length, as in char(30).

--
Regards

Jeff Boyce
<Office/Access MVP>

"Mick Ruthven" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> This is my first Access project to develop, so I'm learning the ropes of
> dealing with SQL Server. One thing that cropped up is that the fields

seems
> to be filled with training blanks. On forms that's only "strange" and an
> inconvenience, but on reports it can force extra rows for "can grow"

fields.
> I solved the problem by doing an rtrim() on all the fields in a query

before
> using them in forms and reports. Is that a known issue and is there a
> better/easier way to handle it?
>
> Thanks,
>
> Mick Ruthven
>
>


 
Reply With Quote
 
Mick Ruthven
Guest
Posts: n/a
 
      27th Jan 2006
Bingo! The offending fields are char, not varchar. Is there any reason to
not make all non-numeric fields varchar? Any drawbacks?

"Jeff Boyce" <(E-Mail Removed)-DISCARD_HYPHEN_TO_END> wrote in message
news:(E-Mail Removed)...
> Mick
>
> I suspect you are running into an issue with the data type in SQL Server.
> If the data field/column were defined with "varchar" (variable length,
> character type), you shouldn't be seeing trailing blanks.
>
> You might find that the data fields are defined as char (character), with

a
> fixed length, as in char(30).
>
> --
> Regards
>
> Jeff Boyce
> <Office/Access MVP>
>
> "Mick Ruthven" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > This is my first Access project to develop, so I'm learning the ropes of
> > dealing with SQL Server. One thing that cropped up is that the fields

> seems
> > to be filled with training blanks. On forms that's only "strange" and an
> > inconvenience, but on reports it can force extra rows for "can grow"

> fields.
> > I solved the problem by doing an rtrim() on all the fields in a query

> before
> > using them in forms and reports. Is that a known issue and is there a
> > better/easier way to handle it?
> >
> > Thanks,
> >
> > Mick Ruthven
> >
> >

>



 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      27th Jan 2006
I don't see any, but then I'm not a SQL-Server guru. You may want to check
in one of the SQL-related newsgroups.

--
Regards

Jeff Boyce
<Office/Access MVP>

"Mick Ruthven" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Bingo! The offending fields are char, not varchar. Is there any reason to
> not make all non-numeric fields varchar? Any drawbacks?
>
> "Jeff Boyce" <(E-Mail Removed)-DISCARD_HYPHEN_TO_END> wrote in message
> news:(E-Mail Removed)...
> > Mick
> >
> > I suspect you are running into an issue with the data type in SQL

Server.
> > If the data field/column were defined with "varchar" (variable length,
> > character type), you shouldn't be seeing trailing blanks.
> >
> > You might find that the data fields are defined as char (character),

with
> a
> > fixed length, as in char(30).
> >
> > --
> > Regards
> >
> > Jeff Boyce
> > <Office/Access MVP>
> >
> > "Mick Ruthven" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > This is my first Access project to develop, so I'm learning the ropes

of
> > > dealing with SQL Server. One thing that cropped up is that the fields

> > seems
> > > to be filled with training blanks. On forms that's only "strange" and

an
> > > inconvenience, but on reports it can force extra rows for "can grow"

> > fields.
> > > I solved the problem by doing an rtrim() on all the fields in a query

> > before
> > > using them in forms and reports. Is that a known issue and is there a
> > > better/easier way to handle it?
> > >
> > > Thanks,
> > >
> > > Mick Ruthven
> > >
> > >

> >

>
>


 
Reply With Quote
 
Mick Ruthven
Guest
Posts: n/a
 
      27th Jan 2006
Thanks for your help, Jeff! I just discovered the
microsoft.public.access.adp.sqlserver newsgrop which seems like the one to
be asking my Access Project questions in.

"Jeff Boyce" <(E-Mail Removed)-DISCARD_HYPHEN_TO_END> wrote in message
news:(E-Mail Removed)...
> I don't see any, but then I'm not a SQL-Server guru. You may want to

check
> in one of the SQL-related newsgroups.
>
> --
> Regards
>
> Jeff Boyce
> <Office/Access MVP>



 
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
How do I TRIM a field in existing fields....? Kelvin Beaton Microsoft Access 3 23rd Apr 2007 05:32 PM
Trim() concatenated fields of list row source =?Utf-8?B?anN0ZWV2ZXM=?= Microsoft Access Forms 7 13th Aug 2006 04:36 PM
Why won't my Access Data Project work with linked child fields? =?Utf-8?B?QWFyb25TdGV3YXJ0?= Microsoft Access VBA Modules 0 2nd Aug 2006 12:06 AM
Access Project - need to trim fields Mick Ruthven Microsoft Access ADP SQL Server 4 27th Jan 2006 05:53 PM
Trim spaces in address fields =?Utf-8?B?U2FuZHk=?= Microsoft Access 6 12th May 2005 03:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:44 PM.