Setting field lengths of queries

G

gxdata

[Access 2003]
If I have a query which calculates a text field and will return just 3
characters (eg, myfield: left([state],3) ) then is it possible in any way to
have the field length of the new [myfiled] returned as just 3 charcaters
long - rather than 255 characters?

For non-calculated fields, it seems that the field length of the underlying
tables' fields will determine the query's field length. Example, if text
field TableA.[Address] has length 50, a query returning this field will also
have a field length of 50.

If not, what's a convenient work-around?
 
M

[MVP] S.Clark

It sounds like you are using a Make Table query, which results in the
Text(255) field. Instead of a Make Table, you could use an Append query,
and write to a table that is already structured the way that you need it to
be. (Empty the table before each running of the Append.)
 
G

Guest

Append Queries YES = Correctly structured data
Make Table Queries NO = Excessive space, ambiguous data types

Note that the 255 field length is only the default. It can be changed:
Tools, Options Tables/Queries tab.


[MVP] S.Clark said:
It sounds like you are using a Make Table query, which results in the
Text(255) field. Instead of a Make Table, you could use an Append query,
and write to a table that is already structured the way that you need it to
be. (Empty the table before each running of the Append.)

--
Steve Clark, Access MVP
http://www.fmsinc.com/consulting
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

gxdata said:
[Access 2003]
If I have a query which calculates a text field and will return just 3
characters (eg, myfield: left([state],3) ) then is it possible in any way
to have the field length of the new [myfiled] returned as just 3
charcaters long - rather than 255 characters?

For non-calculated fields, it seems that the field length of the
underlying tables' fields will determine the query's field length.
Example, if text field TableA.[Address] has length 50, a query returning
this field will also have a field length of 50.

If not, what's a convenient work-around?
 

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