Mysql function to DBIx::Class translation

374 Views Asked by At

I want to convert this mysql/select query with function to DBIx::Class but I can't construct it the right way.

Mysql/query with function:

mysql> select * from sold_products 
       where date_sub(curdate(), interval 100 day) <= date;

Result query on DBIC_TRACE:

SELECT me.fk_product, me.fk_customer, me.amount, me.quantity, me.date, me.pk_sold 
FROM sold_products me WHERE ( date > date_sub(curdate(), interval 100 day ):

P.S DBIx is already upgraded.

thanks, lupin

1

There are 1 best solutions below

0
On

In your DBIx query you want the hash key to be '>=', not '>'. date => {'>=', whatever_here }? Did you try that already?