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.

Extracting week from field

Featured Replies

Hi there

I have a field with this date format in it: 4/16/07 - 4/22/07

That I want to extract the week number from for the second date set

I am familiar with the week(field) format but that's based on a particular date. This field is just a number field at the moment and as you can guess the field length changes as the dates do eg.

1/3/07 - 12/19/07 so the standard left(field) command won't work either.

Anyone come across this before or have a solution?

Regards

Mark

Edited by Guest

First, the field should be a TEXT field - because "4/16/07 - 4/22/07" is neither a date nor a number.

You can extract the starting date by:

GetasDate ( Leftwords ( YourField ; 1 ) )

or the week directly:

WeekOfYear ( Leftwords ( YourField ; 1 ) )

---

This is assuming your date format is set to m/d/y.

Edited by Guest

You can also use this custom function to extract all valid dates from a text.

Then do :B

Week ( GetValue ( GetDates ( yourField ) ; X ))

where X is the date you want, e.g. 2 if you want the week of the second date.

  • 2 weeks later...
  • Author

You can also use this custom function to extract all valid dates from a text.

Then do ???

Week ( GetValue ( GetDates ( yourField ) ; X ))

where X is the date you want, e.g. 2 if you want the week of the second date.

Hi there fabrice

Thanks for the link.

I tried the custom function but when I paste it into filmaker as a new custom functions I'm getting a few errors.

It doesn't recognise and number of the arguments and also says there are too many parameters.

Unfortunatley it's beyond my skill level.

thanks anyhow it looks like a great function.

Regards

Mark

I just made a sample for you. Using v8.5.

The Custom Function must have a function that wasn't in v7, and as I tested it in v7, v8, and v8.5 and it is the only one that will not work.

HTH

Lee

p.s. updated because I noticed the version being used.

forDNA.fp7.zip

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.