Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Agent, Actions, Rules & Automation >> How do I use the days() function
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1195590575

Message started by Michael Niemann on Nov 20th, 2007, 3:29pm

Title: How do I use the days() function
Post by Michael Niemann on Nov 20th, 2007, 3:29pm

I created a user attribute "QuerySent" with a date format that contains the date when I sent a query to an editor. Now I'd like to create an agent that collects all notes where the "QuerySent" attribute is at least 30 days old. I thought I could use the days function but it does not yield the results I hoped for.

Here's what I put into the agent:      days(QuerySent,today)>30

but the agent did not collect any notes even though there are some that satisfy this requirement.

Here's what did work:    QuerySent<today-30

Maybe I just don't know how to use date functions. Thanks in advance. Michael

Title: Re: How do I use the days() function
Post by Mark Bernstein on Nov 20th, 2007, 4:07pm

The query language is more restrictive than the action language.  In an action, days(....)) is a function.  In a query, days(...) attempts to determine whether the attribute "days" contains a regular expression.

The easiest thing here is to rephrase the query, as you have done.  You could also add a numeric attribute and a rule:

    WaitingTime=days($SubmissionDate,today)

and just test WaitingTime

Title: Re: How do I use the days() function
Post by Michael Niemann on Nov 20th, 2007, 6:25pm

Ahh, I get it. I guess my solution works just fine. Thanks for the insight. It does not take much to create another attribute and then use that value.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.