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

Popular posts from this blog

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

c# - Update a combobox from a presenter (MVP) -