April 28, 200718 yr 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, 200718 yr by Guest
April 28, 200718 yr 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, 200718 yr by Guest
April 28, 200718 yr 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.
May 6, 200718 yr 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
May 6, 200718 yr 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