Field Size Decreases

S

shallynd

Hi..
I am needing to export a table that has a field size of 80 to a fixed width
text file with a field size of 55. When I do this, I lose the data an the end
of the field. Is there anyway to force Access to possible create a new row
of data so that I don't lose this data. I'm thinking I would do this before
the export of data?

These are comments that have been left in the database and we are moving to
a new system which is why the field size changes and I can't change the new
system. :(

Any help would be great!
 
J

Jerry Whittle

In a query, you could use the Left function to get the first 55 characters
and put them in one field. then you could use the Mid function to get any
characters after the first 55 and put them in another field.

First55: Left([FieldName], 55)

TheRest: Mid([FieldName], 56, 25)
 
J

John W. Vinson

Hi..
I am needing to export a table that has a field size of 80 to a fixed width
text file with a field size of 55. When I do this, I lose the data an the end
of the field. Is there anyway to force Access to possible create a new row
of data so that I don't lose this data. I'm thinking I would do this before
the export of data?

These are comments that have been left in the database and we are moving to
a new system which is why the field size changes and I can't change the new
system. :(

Any help would be great!

A UNION query can do this:

SELECT field, field, Left([problemfield], 55), field, field...
FROM yourtable
UNION ALL
SELECT field, field, Mid([problemfield], 56), field, field...
FROM yourtable
WHERE Len([problemfield]) > 55
ORDER BY <some reasonable field>

You can then export from the stored UNION query.
 

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