Select Webform submissions between a date range

Description

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.

Snippet

SELECT sub.sid, data.data, FROM_UNIXTIME(submitted, '%d/%m/%Y')
FROM webform_submissions as sub, webform_submitted_data as data
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');

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options