Posted by: mani7able | December 25, 2012

Day-315 Views Date Format SQL

Module Name: Views Date Format SQL


The Views Date Format SQL module allows to format date fields using SQL. Thisenables group aggregation for date fields using the choosen granularity.

The core functionality is to remove the date formatting from render() and put it in query(). I.e. format date values using SQL’s DATE_FORMAT rather than PHP’s format_date.
This is achieved by assigning a new default handler to node ‘created’ and ‘changed’ date fields. This handler extends and overrides views’s build in views_handler_field_date.

The UI is completely unobtrusive, only a single checkbox “Use SQL to format dates” is added.


  • Add or edit a view.
  • Enable Aggregation.
  • Add a date field or edit one by clicking the field name.
  • In the “Configure Field” pop-up look for “Use SQL to format date
  • Try setting the date format to something like “Y-m” for monthly reports

Project Information:

Reported installs: 295 sites currently report using this module. View usage statistics.



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: