DATE_FORMAT error in ruby in rails 4 with sql server 2014 as a database on windows 7
问题 i am getting DATE_FORMAT error in ruby on rails with sql server as a database <% date = Date.today %> <% @employees = Employee.where("status = ? AND DATE_FORMAT(date_of_birth,'%d/%m') = ?", "Active" , date.strftime('%d/%m')) %> 回答1: Try this, <% date = Date.today %> <% @employees = Employee.where("status = ? AND FORMAT(date_of_birth,'dd/MM','en-US') = ?", "Active" , date.strftime('%d/%m')) %> Learn more about Format function 来源: https://stackoverflow.com/questions/43270910/date-format-error