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 "char" fields
seem 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. I could use varchar instead of
char to avoid the issue and the need to trim. I may be missing something
about this issue. What's the best practice here?

Thanks,

Mick Ruthven
 
S

Sylvain Lafontaine

Excerpt for one char long fields and fixed size fields like serial numbers,
you should always use varchar instead of char on SQL-Server.

Because of internationalisation and localisation issues, an even better idea
would be to use nchar, nvarchar and ntext fields instead of char, varchar
and text fields.
 
M

Mick Ruthven

Thanks, Sylvain! How about a bit more explanation of why the "n"-type fields
are best?
 
M

Mick Ruthven

Thanks again, Sylvain. You've made my learning process about this much
quicker.
 

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