Logic problem in ruby on rails with data retrieve from MySQL

For my ruby in rails application. i need to display the report of last
one year. so i decide to take the current date and subtract one then
will
get the last year. And then take the datas from the mysql with that new
date…
is this correct logic?.. or can i get value from the MySQL, after
done
the one year subtracted operation in MySQL…?