[Django]-Selecting date formats for aggregate calculations from database with Django

6👍

Run the following in your MySQL database, to create a forwarding function.

delimiter //

create function strftime ( d date, format varchar(255) )   
   RETURNS varchar(64)
   LANGUAGE SQL
   DETERMINISTIC
   COMMENT 'synonym for date_format'
   return date_format(d, format) ;
//
delimiter ;
👤tpdi

Leave a comment