Skip to content

Instantly share code, notes, and snippets.

@BrandonMathis
Created August 8, 2011 19:31
Show Gist options
  • Save BrandonMathis/1132519 to your computer and use it in GitHub Desktop.
Save BrandonMathis/1132519 to your computer and use it in GitHub Desktop.
Query for events
SELECT node.nid AS nid, node.title AS node_title, node_data_field_date.field_event_location_value AS node_data_field_date_field_event_location_value, node.type AS node_type, node.vid AS node_vid, node.created AS node_created, node_revisions.body AS node_revisions_body, node_revisions.format AS node_revisions_format, node_data_field_weight.field_weight_value AS node_data_field_weight_field_weight_value FROM drup_node node LEFT JOIN drup_content_type_event node_data_field_date ON node.vid = node_data_field_date.vid LEFT JOIN drup_node_revisions node_revisions ON node.vid = node_revisions.vid LEFT JOIN drup_content_field_weight node_data_field_weight ON node.vid = node_data_field_weight.vid WHERE ((node.type in ('event')) AND (node.status <> 0)) AND (DATE_FORMAT(CONVERT_TZ(STR_TO_DATE(node_data_field_date.field_date_value2, '%Y-%m-%dT%T'), 'UTC', 'America/New_York'), '%Y-%m') >= '2011-08') ORDER BY node_data_field_weight_field_weight_value ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment