• 0

# Formula to get value in a table

## Question

Hello, I have a value in a table, let's just say it's a first name and last name in a single field. I want to be able to get the first name using formula field. Is this possible? Example, I have "Walt Disney". I want to be able to get the value 'Walt' as it is the first name. Thanks to whoever will answer.

## Recommended Posts

• 0

Hi, I am assuming that you are trying to get the first value as it is your first name. If that's the case I think your formula should be somewhat as this:

LEFT([@field:Name],CHARINDEX(' ',[@field:Name] + ' ')-1)

##### Share on other sites

• 0

Thanks, this works for me. As you know, getting the last name might come in handy for the future. Can you also help me get those values of my last name (in this case 'Disney')? Thank you so much

##### Share on other sites

• 0

I have encountered this a few times, @joneslovescaspio. And I think this may help:

CASE WHEN CHARINDEX(' ',[@field:Name]) > 1 THEN REVERSE( LEFT( REVERSE([@field:Name]), CHARINDEX(' ', REVERSE([@field:Name]))-1 ) ) ELSE '' END

I hope this works too. Thanks.

##### Share on other sites

• 0

I would like to add this to those who also like to get the first 10 fields of their characters in the formula field:

LEFT([@field:Name] , 10)

and in Calculated fields:

SELECT LEFT([@field:Name] , 10) from tableName where condition

Hope this helps.

##### Share on other sites

• 0

oops, does this also applies to the last 10 fields? I'll just make the LEFT to RIGHT?

On 3/22/2019 at 12:04 PM, OppaShinJoonYoung said:

I would like to add this to those who also like to get the first 10 fields of their characters in the formula field:

LEFT([@field:Name] , 10)

and in Calculated fields:

SELECT LEFT([@field:Name] , 10) from tableName where condition

Hope this helps.

##### Share on other sites

• 0

Yes, the RIGHT function allows you to extract a sub string from a string, starting from the right-most character.

Formula should be somewhat like this: RIGHT([@field:Name] , 10)

and in Calculated fields:

SELECT RIGHT([@field:Name] , 10) from tableName where condition

• 0

##### Share on other sites

• 0

Caspio's YouTube channel also had a livestream with Ned where he discussed more about using SQL. You can watch that here:

- LOEY

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.