Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obtain last field in a text / memo field

Status
Not open for further replies.

cantab55

MIS
Nov 9, 2005
1
US
I have a memo field comprised of words, numbers, etc. and I want to return only the last word as the value in a report I am running.
 
If you are using version 9.0 or higher, you should be able to use a formula like:

split(trim({table.memo})," ")[ubound(split(trim({table.memo})," ")]

Otherwise, you would need to create SQL expressions like:

[{%first254}:]
(substr(table.`memo`,1,254))

[{%second254}:]
(substr(table.`memo`,255,254))

Then create a formula like the following:

if isnull({%second254}) then
split({%first254}," ")[ubound(split({%first254}," "))] else
split({%second254," ")[ubound(split({%second254}," "))]

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top