Date madness

I have a column called ‘time_in’ and it is actually a timestamp so it
has a date and a time.

I created a method in my model called time_in_date which is simply

I can’t do an sql find on a column that doesn’t exist so how do I find
for a specific date?


If you’re using mysql have a look at its date functions:

Model.find(:all, :conditions => [‘DATE(time_in) = ?’,]) may
be what you want.


Postgres but I’ll start with that tomorrow…



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