Jump to content

Converting Text to Date


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

Recommended Posts

  • Newbies

Hello,

I've imported a .csv file that has the date formatted as yyyy-mm-dd, it imported into FMP as a text field. Is there a way to convert that field to a date with the mm-dd-yyyy date format? I've searched the forums and couldn't find anything specifically talking about it.

 

Thanks,

Jim

Link to comment
Share on other sites

 create a calculation field

remember to back up first.

 

Let([
adj =Substitute ( YourImportedTextField ; "/" ; ¶ ) ;
month = GetValue ( adj ; 2 ) ;
day = GetValue ( adj ; 3 ) ;
year = GetValue ( adj ; 1 )
];
Date ( month ; day ; year )
)

Link to comment
Share on other sites

Or, actually, since the OP indicated that the incoming data is separated by dashes rather than slashes, change Robert Taylor's calculation to 

adj =  Substitute(YourImportedTextField; "-"; ¶);

Link to comment
Share on other sites

This topic is 3003 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.