I want to return four possible values - 1, 2, 3, 4 - based on the following conditions:
If the difference in one date vs today's date is >= 7, return a 1.
If the difference in one date vs today's date is >=14, return a 2.
If the difference in one date vs today's date is >=21, return a 3.
If the difference in one date vs today's date is >=30, return a 4.
Here's what I wrote:
IF((Datecomp(Now(),${Contacts.last_login})/1440)>=7,1,
IF((Datecomp(Now(),${Contacts.last_login})/1440)>=14,2,
IF((Datecomp(Now(),${Contacts.last_login})/1440)>=21,3,
IF((Datecomp(Now(),${Contacts.last_login})/1440)>=30,4,5))))
Syntax checker says: Syntax Error. Check the examples for any functions you're using to see
if you formatted them correctly. Make sure your fields are formatted
like this: ${Module Name.Field Name}.
How does one include an AND statement in this string?
I can't use just the "=" operator because I only update the "last_login" field every few days. If it were updated daily, then I could use the EQUAL operator.
Also, how does one update all records automatically?