Query for Created 'Last Month'?


#1

Hi everyone,

I’m not very good with SQL queries, so I’m having trouble constructing
a URL like this to select all tickets from last month…

http://rt.me.org/Search/Results.tsv?Order=DESC|DESC|DESC|ASC&Query=%20Created%20>%20’2008-06-01’%20AND%20Created%20<%20’2008-06-30’&...etc

It would be nice if “Created = ‘Last Month’” would work, but of course,
it doesn’t. :slight_smile: Any ideas?

js.
Jean-Sebastien Morisset, Sr. UNIX Administrator jsmoriss@mvlan.net


#2

Created > 'Last Month’On Thu, Jul 3, 2008 at 4:34 PM, Jean-Sebastien Morisset jsmoriss@mvlan.net wrote:

Hi everyone,

I’m not very good with SQL queries, so I’m having trouble constructing
a URL like this to select all tickets from last month…

http://rt.me.org/Search/Results.tsv?Order=DESC|DESC|DESC|ASC&Query=%20Created%20>%20’2008-06-01’%20AND%20Created%20<%20’2008-06-30’&...etc

It would be nice if “Created = ‘Last Month’” would work, but of course,
it doesn’t. :slight_smile: Any ideas?

js.

Jean-Sebastien Morisset, Sr. UNIX Administrator jsmoriss@mvlan.net


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.


#3

Hi everyone,

I’m not very good with SQL queries, so I’m having trouble constructing
a URL like this to select all tickets from last month…

http://rt.me.org/Search/Results.tsv?Order=DESC|DESC|DESC|ASC&Query=%20Created%20>%20’2008-06-01’%20AND%20Created%20<%20’2008-06-30’&...etc

It would be nice if “Created = ‘Last Month’” would work, but of course,
it doesn’t. :slight_smile: Any ideas?

Created > ‘1 month ago’

:wink:


#4

Created > ‘Last Month’

Ruslan,

Thanks, but that gives me this month too. :slight_smile: I tried the following,
just in case, but it doesn’t work…

Created > 'Last Month' AND Created < 'This Month'

js.> On Thu, Jul 3, 2008 at 4:34 PM, Jean-Sebastien Morisset jsmoriss@mvlan.net wrote:

Hi everyone,

I’m not very good with SQL queries, so I’m having trouble constructing
a URL like this to select all tickets from last month…

http://rt.me.org/Search/Results.tsv?Order=DESC|DESC|DESC|ASC&Query=%20Created%20>%20’2008-06-01’%20AND%20Created%20<%20’2008-06-30’&...etc

It would be nice if “Created = ‘Last Month’” would work, but of course,
it doesn’t. :slight_smile: Any ideas?

js.

Jean-Sebastien Morisset, Sr. UNIX Administrator jsmoriss@mvlan.net


#5

ok, then http://search.cpan.org/dist/Time-modules/lib/Time/ParseDate.pm
needs patching.On Thu, Jul 3, 2008 at 5:17 PM, Jean-Sebastien Morisset jsmoriss@mvlan.net wrote:

On Thu, Jul 03, 2008 at 05:14:07PM +0400, Ruslan Zakirov wrote:

Created > ‘Last Month’

Ruslan,

Thanks, but that gives me this month too. :slight_smile: I tried the following,
just in case, but it doesn’t work…

Created > ‘Last Month’ AND Created < ‘This Month’

js.

On Thu, Jul 3, 2008 at 4:34 PM, Jean-Sebastien Morisset jsmoriss@mvlan.net wrote:

Hi everyone,

I’m not very good with SQL queries, so I’m having trouble constructing
a URL like this to select all tickets from last month…

http://rt.me.org/Search/Results.tsv?Order=DESC|DESC|DESC|ASC&Query=%20Created%20>%20’2008-06-01’%20AND%20Created%20<%20’2008-06-30’&...etc

It would be nice if “Created = ‘Last Month’” would work, but of course,
it doesn’t. :slight_smile: Any ideas?

js.


Jean-Sebastien Morisset, Sr. UNIX Administrator jsmoriss@mvlan.net

Best regards, Ruslan.


#6

It would be nice if “Created = ‘Last Month’” would work, but of course,
it doesn’t. :slight_smile: Any ideas?

Created > ‘1 month ago’

I didn’t read your message enough, this isn’t an answer to your request,
sorry :frowning:


#7

ok, then http://search.cpan.org/dist/Time-modules/lib/Time/ParseDate.pm
needs patching.

What do you think of this?

diff /usr/local/lib/perl5/site_perl/5.8.8/Time/ParseDate.pm-orig /usr/local/lib/perl5/site_perl/5.8.8/Time/ParseDate.pm

1095a1096,1100

  # 'this' case added by jsmoriss 2008/07/03
  } elsif ($$tr =~ s#^this\s+month(?:\s+|$ )##xi) {
          &calc($rsr, $yr, $mr, $dr, $rdr, $now, "day", - (&righttime($now, %options))[ 3 ], %options);
          printf "matched at %d.\n", __LINE__ if $debug;
          return 1;

js.> On Thu, Jul 3, 2008 at 5:17 PM, Jean-Sebastien Morisset jsmoriss@mvlan.net wrote:

On Thu, Jul 03, 2008 at 05:14:07PM +0400, Ruslan Zakirov wrote:

Created > ‘Last Month’

Ruslan,

Thanks, but that gives me this month too. :slight_smile: I tried the following,
just in case, but it doesn’t work…

Created > ‘Last Month’ AND Created < ‘This Month’

js.

Jean-Sebastien Morisset, Sr. UNIX Administrator jsmoriss@mvlan.net