Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6471 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I need to parse a date from a field. Unfortunately, the way it's entered is not consistent. It's always in MDY format, but somtimes it's M/DD/YY or MM/D/YYYY or MM-DD-YY, etc.

What would be the best way to parse all of this data?

This is on FM5

Thanks

Posted

Try this modified calcalulation that was shared by Bob Weaver.

Let([

Parts=Substitute(

YourDateField; ["/";" "]; ["-" ; " "]);

Month=LeftWords(Parts;1);

Day=MiddleWords(Parts;2;1);

Year=RightWords(Parts;1)];

Day &"/"& Month &"/"& Year)

HTH

Lee

Posted

This is the same calc of Lee, but for v. 5 :)

Date (

LeftWords ( Substitute ( Substitute ( YourField , "/" , " " ) , "-" , " " ) , 1 ) ,

MiddleWords ( Substitute ( Substitute ( YourField , "/" , " " ) , "-" , " " ) , 2 , 1 ) ,

If(

Length( RightWords ( Substitute ( Substitute ( YourField , "/" , " " ) , "-" , " " ) , 1 ) ) = 2 ,

"20" & RightWords ( Substitute ( Substitute ( YourField , "/" , " " ) , "-" , " " ) , 1 ) ,

RightWords ( Substitute ( Substitute ( YourField , "/" , " " ) , "-" , " " ) , 1 )

)

)

This topic is 6471 days old. Please don't post here. Open a new topic instead.

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...

Important Information

By using this site, you agree to our Terms of Use.