@products = Product.find_by_sql "SELECT *...... "

hello all

i have a trouble whit a controller

i need filter the collection by a date, but i dont know how to get the
values of a date, because i need that values to build my sql sentences

for example:

@products = Product.find_by_sql "SELECT * FROM products WHERE 

cdbl(date_availabe) > " + first_date_double_value + " AND
cdbl(date_available) <= " + second_date_double_value

first_date_double_value & second_date_double_value

are the values that i dont know how to get

neither taking of Date.today value

please i need your help
tanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs