Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
How do I use the days() function (Read 8492 times)
Michael Niemann
Full Member
*
Offline



Posts: 2
Hartford, CT
How do I use the days() function
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
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: How do I use the days() function
Reply #1 - 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
Back to top
 
 
WWW   IP Logged
Michael Niemann
Full Member
*
Offline



Posts: 2
Hartford, CT
Re: How do I use the days() function
Reply #2 - 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.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print