DNA Posted April 28, 2007 Posted April 28, 2007 (edited) 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 April 28, 2007 by Guest
comment Posted April 28, 2007 Posted April 28, 2007 (edited) 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 April 28, 2007 by Guest
fabriceN Posted April 28, 2007 Posted April 28, 2007 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.
DNA Posted May 6, 2007 Author Posted May 6, 2007 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
Lee Smith Posted May 6, 2007 Posted May 6, 2007 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
Recommended Posts
This topic is 6472 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 accountSign in
Already have an account? Sign in here.
Sign In Now