in reply to Querying Date Ranges with DBIx::Class
In the first case one of your eventdates is clobbered by the other, and you need to change '=<' to '<=':
In the second case 'between' should be '-between':my @events = $schema->resultset( 'MyTable' )->search({ eventdate => { '>=' => $date1, '<=' => $date2 } });
my @events = $schema->resultset( 'MyTable' )->search({ eventdate => { -between => [ $date1, $date2 ] } });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Querying Date Ranges with DBIx::Class
by phildeman (Scribe) on Sep 09, 2014 at 12:41 UTC |