Select Webform submissions between a date range

This snippet will select Webform (Webform module) submitted data between a given date range. In this case, that date range is between 2009-06-04 and 2009-07-07.

The UNIX_TIMESTAMP function converts the date into a Unix Timestamp. This is because the value of submitted is in Unix Timestamp format.

  1. SELECT sub.sid,, FROM_UNIXTIME(submitted, '%d/%m/%Y')
  2. FROM webform_submissions as sub, webform_submitted_data as data
  3. WHERE sub.sid = data.sid AND submitted >= UNIX_TIMESTAMP('2009-06-04 00:00:01') AND submitted <= UNIX_TIMESTAMP('2009-07-07 23:59:59');

If you liked this, you'll love my book, Master Drupal Module Development.

"..the must have drupal developers book"

Feeling stuck with Drupal 8 module dev?

Get the free 7 lesson course that will help you get started today without feeling overwhelmed.

  • Create Drupal modules with just a few commands using the Drupal Console
  • Create custom pages
  • Create custom blocks
  • Create admin forms
  • Demystify routers and controllers
  • Bonus material

Find out more


I am still not very familiar with these fragments and to me that would take time to read them!

Add new comment