query a certain amount of characters

A

abc

i have a memo field consisting of 600 characters. i need to query the
first 255 characters which will display this text. please help!
 
A

abc

is there a reason why its not pulling all of the records in my table?
i need it to pull each and every record displaying the first 255
characters.. for ex. even if a record only has 6 characters.
 
R

Rick B

The criteria in your query determines what pulls. As long as you have
nothing in the Criteria section, it will pull all records.
 
A

abc

i thought '=left([somefield],255' should be in criteria? where do i
enter this in if criteria is blank?
 
R

Rick B

You would add a new column to your query and give it a name.

LeftOfMemo: Left([somefieldname],255)

another column would be...

MidOfMemoField: Mid([somefieldname],256,255)


etc.
 
A

abc

i'm not sure i'm entering this is correctly. i add my table. first
column i select the field and table name. 2nd column, i enter
Left([somefieldname],255) in criteria?
 
R

Rick B

Noooo
not in the criteria. In the field name

and you need to enter the name and the colon.


LeftOfMemo: Left([somefieldname],255)

you are creating a new field (column) in your query.

You are saying, "pull the left 255 characters and call it 'LeftOfMemo' so
that I can use this query in a report and I will have a new field to pull
that is named 'LeftOfMemo'."
 
A

abc

thank you for clarifying!

i'm trying to truncate the next 255...

RightOfMemo: Right([somefieldname],510,256,255)

and i'm getting an error message that i have the wrong number of
arguments... can someone help!
 
J

John Vinson

RightOfMemo: Right([somefieldname],510,256,255)

and i'm getting an error message that i have the wrong number of
arguments... can someone help!

Did you... ummm... consult the Help file? You need the VBA editor
open, but it gives detailed instructions for Left(), Right(), and
Mid().

Right() takes two arguments, a string value (or the name of a field
containing the string), and the number of characters to select,
counting backwards from the end of the string.

Mid() takes three arguments, a string value (or fieldname), a start
position, and a numbre of characters.

To get the 256th through 511th character of a memo field (a very
strange and probably undesirable thing to do, but that's your call)
use

Mid([somefieldname], 256, 255)

To get the rightmost 255 bytes (which might be bytes 1 through 255, or
33123500 through 33123755) use

Right([somefieldname], 255)


John W. Vinson[MVP]
 
A

abc

i need the LEFT, MID, RIGHT fields to pull the first 255 characters,
next 255 char, and the last 255 characters.. because I'm connecting
this to Infopath (which does not support memo types).

using :Right([somefieldname], 255) (from above)
gives me the same results as using "LEFT".

please help! i need to pull the last 255 characters.
 
J

John Vinson

i need the LEFT, MID, RIGHT fields to pull the first 255 characters,
next 255 char, and the last 255 characters.. because I'm connecting
this to Infopath (which does not support memo types).

using :Right([somefieldname], 255) (from above)
gives me the same results as using "LEFT".

please help! i need to pull the last 255 characters.

Is the memo field in fact longer than 255 characters? If you put in a
calculated field Len([somefieldname]) what do you see? What would you
want to see if the field were (say) 300 bytes long, or 1000?

John W. Vinson[MVP]
 
Top