Choose Language Hide Translation Bar
Highlighted
New Contributor

## Extracting number from numbers

Hi,

I have a question about extracting number from numbers.

Let's say I have a data set like this below, which is YYYYMMDDTTMMSS.

I want to extract YYYY, MM, and DD, seperately and make it like below.

What kind of formula should I use to make it like this? Thank you in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions
Staff

## Re: Extracting number from numbers

You will probably see several different ways to do this. Here is one approach (you will see a pattern):

For Year: Num( Substr( Char( :TIME_DATA ), 1, 4 ) )

For Month: Num( Substr( Char( :TIME_DATA ), 5, 2 ) )

For Day: Num( Substr( Char( :TIME_DATA ), 7, 2 ) )

Dan Obermiller
2 REPLIES 2
Staff

## Re: Extracting number from numbers

You will probably see several different ways to do this. Here is one approach (you will see a pattern):

For Year: Num( Substr( Char( :TIME_DATA ), 1, 4 ) )

For Month: Num( Substr( Char( :TIME_DATA ), 5, 2 ) )

For Day: Num( Substr( Char( :TIME_DATA ), 7, 2 ) )

Dan Obermiller
Highlighted
New Contributor

## Re: Extracting number from numbers

It works really well!! Thank you so much for your help!!