Jump to content
We've recently updated our Privacy Statement, available here ×

Generate a new text field from the first 8 characters of a queried surname field


jenkins

Recommended Posts

Hi there,

In a nutshell: I would like to create a list of participants of an event. The list should contain at least the following 3 fields: Surname, Name and Account. Surname and Name are fields from the database whereas Account will be generated.

The problem: The field Account should be lower-case and 8 characters long. Furthermore, it should be generated from the first 8 characters of Surname (and Name if Surname is too short).

If anyone out there has already done something like this or knows how to go about it, help would be much appreciated!

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I have basically solved this problem at the SQL level instead of at the text field expression level. The Account name is derived only from the field Surname taking up to the first 8 characters. For this I used:

 

Select REPLACE(LOWER(LEFT(pePersons.`LastName`, 8)), ' ', '') AS Account

 

If anyone has a better solution I'd be happy to hear it!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...