DATE_FORMAT error in ruby in rails 4 with sql server 2014 as a database on windows 7 -
i getting date_format error in ruby on rails sql server database
<% date = date.today %> <% @employees = employee.where("status = ? , date_format(date_of_birth,'%d/%m') = ?", "active" , date.strftime('%d/%m')) %>
try this,
<% date = date.today %> <% @employees = employee.where("status = ? , format(date_of_birth,'dd/mm','en-us') = ?", "active" , date.strftime('%d/%m')) %>
learn more format function
Comments
Post a Comment