I've got the following code:
package MyPackage::ResultSet::Case;
use base 'DBIx::Class::ResultSet';
sub cases_last_fourteen_days {
my ($self, $username) = @_;
return $self->search({
username => $username,
date => { '>=' => 'DATE_SUB(CURDATE(),INTERVAL 14 DAY)' },
});
};
But when I try to use it this way:
$schema->resultset('Case')->cases_last_fourteen_days($username)
I always get zero results, can anyone tell what I'm doing wrong?
Thanks!
->as_query
which will return resulting query – Strother