Skip to content

Instantly share code, notes, and snippets.

@jondavidjohn
Forked from anonymous/gist:f87f827d02adfcb1d973
Last active August 29, 2015 14:14
Show Gist options
  • Save jondavidjohn/7423af5bd6d88b73b189 to your computer and use it in GitHub Desktop.
Save jondavidjohn/7423af5bd6d88b73b189 to your computer and use it in GitHub Desktop.
SELECT entry_id, DATEDIFF(from_unixtime(field_id_162, '%Y-%m-%d'), from_unixtime(field_id_267, '%Y-%m-%d')) as days, CONVERT_TZ(from_unixtime(field_id_267, '%m/%d/%Y %h:%i %A'), 'GMT', 'CST') as start, from_unixtime(field_id_162, '%m/%d/%Y %h:%i %A') as end FROM exp_channel_data Where field_id_162 != '' AND field_id_729 != '' AND field_id_267 BETWEEN UNIX_TIMESTAMP('2015-01-01') AND UNIX_TIMESTAMP('2015-02-12')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment