HELP!!
I want to search for a row in a table using current date that falls between a start and end date, using DBIx::Class. The data type for the 2 date columns (in SQL Server) is datetime.
my $dt = DateTime->now( time_zone => "America/New_York" ); my $mydatarow = $schema->resultset( 'DataTable' )->search({ START_DATE + => { '>=' => $dt }, END_DATE => { '=<' => $dt }})->single;
The results are empty, yet when I go into the database there is a record that meets my criteria. The record
that meets the criteria is
START_DATE = 2019-09-03 00:00:00.000 and
END_DATE = 2019-12-20 00:00:00.000.
The current date is 2019-09-05. $dt is 2019-09-05 00:00:00.
I am using DBIx::Class::InflateColumn::DateTime as part of my database package.
What can I do to make this return the result I am looking for?
Thanks for your help!
In reply to Searching a Date between 2 dates with DBIx::Class by phildeman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |