Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to convert date from text to date format

Featured Replies

  • Newbies

Hi:

I have imported data from an old HyperCard file into FM Pro Advanced v8.5.

Data in one of the fields is for date and another is for time. Both were imported as text fields.

Data in the Time field appears like so (for example):) 12:10 PM. I changed this field's type from text to time. Viewing all the data as a table and clicking the column header to sort seems to work fine.

Data in the Date field appears like so (for example): Friday, March 16, 2007.

What I want to do is convert this exact data (that is keep the date as--in the example above--Friday, March 17, 2007), but convert the field type from text to date to allow for easy sorting.

I suspect this requires some scripting and/or calculation. I'm a newbie and could use the help.

TIA,

Mike

Hi

let say that the name of your date field ( coming from HyperCard ) is:

HCtextDate

A possible calc to obtain a real date is:

Let([

mName = MiddleWords ( HCtextDate ; 2 ; 1 );

mNumber =

Case(

mName = "January";1;

mName = "February";2;

mName = "March";3;

mName = "April";4;

mName = "May";5;

mName = "June";6;

mName = "July";7;

mName = "August";8;

mName = "September";9;

mName = "October";10;

mName = "November";11;

mName = "December";12

)];

Date ( mNumber ; MiddleWords ( HCtextDate ; 3 ; 1 ) ; RightWords ( HCtextDate ; 1 ))

)

Another possible calc is:

Let([

m = Ceiling ( Position ( "JanFebMarAprMayJunJulAugSepOctNovDec" ; Left ( MiddleWords ( HCtextDate ; 2 ; 1 ) ; 3 ) ; 1 ; 1 ) / 3 ) ;

d = MiddleWords ( HCtextDate ; 3 ; 1 );

y = RightWords ( HCtextDate ; 1 )

];

Date ( m ; d ; y )

)

  • Author
  • Newbies

Thanks! Worked great!

Mike

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.