gabbaymeir89 Posted June 10, 2014 Posted June 10, 2014 Hi im still a bit of a beginner with filemaker i have been trying to figure this out but need a little help. I have this function If (GetAsDate ( Date1) - GetAsDate ( Date2 ) < 0 ; Date1 + 28 ; Date1 ) What i need is to turn it in to a loop so that 28 is added to Date1 until Date1 is higher than Date2 I have tries and testes let function and loop, if any one could help Many Thanks Meir
comment Posted June 10, 2014 Posted June 10, 2014 1. Filemaker calculations do not loop. 2. Since you have the Advanced version, you can write a custom function. A custom function can be recursive (i.e. it can call itself in a loop). 3. Looping is not required to solve the current problem. Try = Let ( [ diff = Date2 - Date1 ; periods = Ceiling ( diff / 28 ) ] ; Date1 + Case ( diff > 0 ; 28 * periods ) ) or, if you prefer = Date1 + Max ( 28 * Ceiling ( ( Date2 - Date1 ) / 28 ) ; 0 ) 2
Recommended Posts
This topic is 4090 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