Memo Field to Text Field Conversion

S

Scott

Is there a way to convert a memo field that is longer
than 255 characters to mulitple text fields (ie the first
255 characters to a text field, then the remaining
characters to another text field).
 
P

Pieter Wijnen

Check out the GetChunk method of the Recordset Object
(Requires VBA programming)
HTH

Pieter
 
D

Dirk Goldgar

Scott said:
Is there a way to convert a memo field that is longer
than 255 characters to mulitple text fields (ie the first
255 characters to a text field, then the remaining
characters to another text field).

Suppose for a simple example that you have a table like this:

Table1
-------
ID (primary key)
MemoField (data type memo)
TextField1(data type text)
TextField2(data type text)
TextField3(data type text)

Then I think you could run an update query like this:

UPDATE Table1 SET
TextField1 = Left(MemoField, 255),
TextField2 = Mid(MemoField, 256, 255),
TextField3 = Mid(MemoField, 511, 255)
WHERE MemoField Is Not Null;

That should give you zero-length strings for those text fields beyond
the end of the memo text. If you don't like that, you can run update
queries later to set such fields to Null.
 

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