Hi Experts
I’ve a product like this
ID -> 1
Name -> Xyz
Price -> 30
Created_at -> 02-NOV-07
from_date = Date.new(2, 10, 07)
to_date = Date.new(2, 10, 07)
@product = Product.find_by_sql(“select * from products where
created_at between from_date and to_date”)
code works perfectly, buy my issue is i dont get any data. always says
no record found
but if i use as like this
from_date = Date.new(2, 10, 07)
to_date = Date.new(3, 10, 07)
@product = Product.find_by_sql(“select * from products where
created_at between from_date and to_date”)
then its working fine, i can get the datas.
any suggestions experts?
Thanks in advance,
Bala