最近我将我的数据库从sqlite3更改为mysql.当我运行我的项目时,我在其中一个使用此查询的文件中收到此错误.
date = Date.today 1
@employees = Employee.where(“status =?AND strftime(‘%d /%m’,date_of_birth)=?”,“Active”,date.strftime(‘%d /%m’)
ActionView::Template::Error (Mysql2::Error: FUNCTION hrms_development.strftime does not exist: SELECT COUNT(*) FROM `employees` WHERE (status = 'Active' AND strftime('%d/%m', date_of_birth) = '28/03')):
210:
211:
212:
213:
214:
215:
216:
app/views/home/_group_admin.html.erb:213:in `_app_views_home__group_admin_html_erb___2522183600721478262_91627100'
app/views/home/index.html.erb:17:in `_app_views_home_index_html_erb__2772204906267359422_86967120'
ActionView::Template::Error: Mysql2::Error: FUNCTION hrms_development.strftime does not exist: SELECT COUNT(*) FROM `employees` WHERE (status = 'Active' AND strftime('%d/%m', date_of_birth) = '28/03')