<div dir="ltr">Your first debug line indicates that "Sunday" alone is not being parsed into a meaningful time value. This can be corrected by setting RT config option $AmbiguousDayInPast to 1.<div><br></div><div>
Your second debug line indicates that "last Sunday" is resolving to the immediately previous Sunday, not the Sunday before the immediately previous Sunday (which I suspect you want). The Examples section of the documentation for the most recent version (2013.1113 right now) of Time::ParseDate[1] lists "Sunday before last" as valid input. This might come closer to achieving your desired outcome.</div>
<div><br></div><div>These times will not resolve to a date boundary, like midnight—they will have the correct day, but use the current time. This is probably not what you want. Consider prefixing "midnight" to each of your search values, i.e. "midnight Sunday" and "midnight Sunday before last".</div>
<div><br></div><div>If you can't get the search to work as desired, you could simplify the search to return matches between the current time and "1 week ago" and run it weekly at midnight on Sunday via a dashboard email subscription.</div>
<div><br></div><div>[1] <a href="https://metacpan.org/pod/Time::ParseDate#EXAMPLES">https://metacpan.org/pod/Time::ParseDate#EXAMPLES</a></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 2 September 2014 21:27, Chrilly Cheng <span dir="ltr"><<a href="mailto:chrilde@gmail.com" target="_blank">chrilde@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Alex,<div><br></div><div>Thanks for replying.</div><div><br></div><div>I found logs below, but no more details about it.</div>
<div><br></div><div><div>[Tue Sep 2 10:55:32 2014] [debug]: RT::Date used Time::ParseDate to make 'Sunday' 0 (/usr/share/request-tracker4/lib/RT/Date.pm:222)</div>
<div>[Tue Sep 2 10:55:32 2014] [debug]: RT::Date used Time::ParseDate to make 'last Sunday' 1409482532 (/usr/share/request-tracker4/lib/RT/Date.pm:222)</div><div>[Tue Sep 2 10:55:32 2014] [debug]: RT::Date used Time::ParseDate to make 'Sunday' 0 (/usr/share/request-tracker4/lib/RT/Date.pm:222)</div>
<div>[Tue Sep 2 10:55:32 2014] [debug]: RT::Date used Time::ParseDate to make 'last Sunday' 1409482532 (/usr/share/request-tracker4/lib/RT/Date.pm:222)</div></div><div><br></div><div>And thanks for your reminding, I'm also aware of this, but our manager prefer that label, which is hard to config with the built-in attribute in RT.</div>
<div><br></div><div><br></div><div>Br</div><div>Vodar</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 2, 2014 at 6:35 PM, Alex Peters <span dir="ltr"><<a href="mailto:alex@peters.net" target="_blank">alex@peters.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">What does the debug log say when you run the search?</p>
<p dir="ltr">There are some config options relevant to relative dates, but it's worth verifying first that the two dates are being parsed at all.</p>
<p dir="ltr">P.S. I believe that the built-in Starts ticket attribute is intended to function as a proposed start time.</p>
<div class="gmail_quote"><div><div>On 02/09/2014 8:25 pm, "Chrilly Cheng" <<a href="mailto:chrilde@gmail.com" target="_blank">chrilde@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div>
<div dir="ltr">Do I need to do any setting of the week on server?<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 2, 2014 at 3:59 PM, Chrilly Cheng <span dir="ltr"><<a href="mailto:chrilde@gmail.com" target="_blank">chrilde@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Guys,<div><br></div><div>I was trying to create a qeury which returns all open tickets whose "Proposed Start Date" are in this week, from specific queue. I tried with some build-in variables in searching as showing below:</div>
<div><br></div><div>Queue = 'ChangeRequest' AND ( Status != 'rejected' AND Status != 'resolved' ) AND 'CF.{Proposed Start Time}' > 'last Sunday' AND 'CF.{Proposed Start Time}' < 'Sunday'</div>
<div><br></div><div>but this query returns nothing. <span style="font-family:arial,sans-serif;font-size:13px">BTW, "Proposed Start Time" is a datetime custom field applied to this queue.</span></div><div><br></div>
<div>Can you please help to check on this, see whether it doesn't work? Many thanks.</div><div><br></div><div><br></div><div>Br</div><div>Vodar</div>
<div><br></div><div><br></div></div>
</blockquote></div><br></div></div>
<br></div></div><span><font color="#888888">--<br>
RT Training - Boston, September 9-10<br>
<a href="http://bestpractical.com/training" target="_blank">http://bestpractical.com/training</a><br></font></span></blockquote></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>