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
DueDates (Read 7076 times)
Ben Worthington
Full Member
*
Offline



Posts: 110

DueDates
Mar 14th, 2009, 10:09am
 
I have an agent query DueDate=today.  It's catching notes with a DueDate of today and tomorrow - why is it acting on notes that are due tomorrow?
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: DueDates
Reply #1 - Mar 14th, 2009, 10:58am
 
Date "=" in Tindebrox 4.6.0 is looking for date that are within 24 hours of each other.

Starting in Tinderbox 4.6.1 (now in beta), "=" will be true for dates that have the same calendar date.
Back to top
 
 
WWW   IP Logged
Loryn
Full Member
*
Offline



Posts: 97

Re: DueDates
Reply #2 - Mar 16th, 2009, 3:00pm
 
I'm using Tinderbox 4.6.  All $DevDates are in the evening, and it is now currently morning.

The following query finds the date corresponding to today's entry:
$DevDate=date(Today)

The following queries both fail to find the date corresponding to today's entry:
$DevDate<=date(Today)
($DevDate=date(Today)|$DevDate<date(Today))

The manual implies that these last two queries should be equivalent. And, true, they are returning identical results. But I fail to see WHY they are failing when the first query works. Moreover, I would have thought (and think the manual implies) that the first query (which works) would have found a strict subset of either of the second queries. But it appears not to do so.
Back to top
 
« Last Edit: Mar 16th, 2009, 3:19pm by Loryn »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: DueDates
Reply #3 - Mar 16th, 2009, 3:26pm
 
"today" is a string; it needs quotes.

      $DevDate<=$Date("today")

does find the expected notes. (Omitting the quotes also seems to be OK on my test)
Back to top
 
 
WWW   IP Logged
Loryn
Full Member
*
Offline



Posts: 97

Re: DueDates
Reply #4 - Mar 16th, 2009, 4:30pm
 
Hi Mark

Thanks for the correction about quoting "today".

However, $DevDate<=date("today") fails to find the expected notes.

Works:
$DevDate=date("today")

But as soon as I add < in either this format:
$DevDate<=date("today")

or this format:
($DevDate<date("today")|$DevDate=date("today"))

it ceases to find the expected notes.


Would you like me to send you a test file?
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: DueDates
Reply #5 - Mar 16th, 2009, 4:40pm
 
Yes, please, since in my test file it does find the notes I expect.
Back to top
 
 
WWW   IP Logged
Loryn
Full Member
*
Offline



Posts: 97

Re: DueDates
Reply #6 - Mar 16th, 2009, 6:00pm
 
OK. I sent it.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: DueDates
Reply #7 - Mar 17th, 2009, 4:45am
 
A v4.6+ syntax side note (though, I think, not a cause of problems above) is that there is now a new operator available for testing equality. It's worth mentioning here as the core of the OP's topic is comparing values.

Currently, TB must guess from the context whether the user's code 'A=B' implies setting A to the value of B or testing if the value of A is the same as the value of B. From v.4.6 onwards, you can use '==' (two equals symbols in sequence) to indicate an equality test. Thus A==B compares the values of A and B whilst A=B sets A to B's value.

Indeed, it's good to move to this new syntax as over time a single '=' for a test of equality may no longer function as it originally did. So now:

Equals                   ==
Does not equal       !=
Less than or equal <=
More than or equal >=

Set left value to right   =
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print