Access project - need to trim fields

M

Mick Ruthven

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
 
J

Jeff Boyce

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).
 
M

Mick Ruthven

Bingo! The offending fields are char, not varchar. Is there any reason to
not make all non-numeric fields varchar? Any drawbacks?
 
J

Jeff Boyce

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.
 
M

Mick Ruthven

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top