Truncate question...

  • Thread starter Thread starter cf_coder
  • Start date Start date
C

cf_coder

Guest
I have a text field that contians text seperated by a variable number of space characters (text more-text). more-text ALWAYS begins at the 15th character. I just need the first section of text before the space charcters. I don't need more-text, just text.

Hope that makes sense! (note- this message was truncated because HTML truncates spaces. There should be 14 characters before 'more-text')
 
Last edited:
Try the following:

StartText:trim(left([YourField],14))
 
Ok, if I do Left("ALPHA",14) I get nothing. Pretty sure I got the syntax of that right- ALPHA being the name of the field...
 
You need to put [ ] around your field name. Thus you should have

Left([ALPHA],14)

This will include the spaces, if you want to remove them then use

Trim(Left([ALPHA],14))
 
This is odd- using Left([ALPHA],14) , the query only returns (and properly truncates) records that are longer than 14 characters without more than one space. So:

IMPERIAL ACADE
ST MARYS SCHOO

will show in the query results. But not:

BRIGGS
BRIAN

or any other record with more than one space character seperating the other characters in the record.

This is in Access 2000 format, if that makes a difference.
 
The Left should return a result for all strings regardless of the length of the string, if the string is longer than 14 then it returns the first 14 characters else it returns all characters of the string. This happens regardless of version of Access.
 

Users who are viewing this thread

Back
Top Bottom