Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

I am importing data from a date field formatted as March 9, 2006. I can strip out the month and year using the middle and right function, but cannot extract the day of the month due to the varying length of the month names and lack of leading zeros. Can anyone help?

Thanks

Posted (edited)

Well I'm unsure what you have. It sounds like you are converting each field independently? Because you can have a standard date field set to Auto-enter with:

Let(

[

m = 1 + Div(

Position ( "January__February_March_____April____May______June_____July_____August___SeptemberOctober__November_December_" ; LeftWords(textDate ; 1 ) ; 1 ; 1 ) - 1 ; 9 ) ;

d = MiddleWords(textDate ; 2 ; 1 ) ;

y = RightWords ( textDate ; 1 )

] ;

Date(m;d;y)

)

I would bet there are shorter ways as well ... such as using a Value List of the months, etc. But the date can be converted in one whack! This cute tid-bit of using Position() and set number of characters (filling in with underlines until it equals 9) was picked up from -Queue-.

UPDATE: There are only two plain underlines between October and November but it looks like it's underline-space-underline. Not sure if it's my display; my eyes; my mind; or the forum. :

L

Edited by Guest
Added Update
Posted

... but cannot extract the day of the month ...

To extract the day of the month use this calc:

MiddleWords ( importedDate ; 2 ; 1 )

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