我正在尝试选择日期范围内具有 created_by 属性的所有记录:
@start = params[:start].to_datetime
@end = params[:end].to_datetime
@registrations = Registration.where("created_at >= #{ @start } and created_at <= #{ @end }")
但是我从 postgres 收到一个错误,上面写着:
PG::Error: ERROR: syntax error at or near "T00"
LINE 1: ...M "registrations" WHERE (created_at >= 2013-06-01T00:00:00+...
我一直在搜索这个,但这次谷歌没有通过......