Advertisement
BakerMan

All Months This Year Containing Events (TEC)

Oct 22nd, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.31 KB | None | 0 0
  1. -- We are only interested in months
  2. SELECT DISTINCT SUBSTR(meta_value, 6, 2)
  3. FROM wp_postmeta
  4.  
  5. -- Where the event starts this year
  6. WHERE meta_key = '_EventStartDate'
  7. AND meta_value > '2012-01-01 00:00:00'
  8. AND meta_value < '2012-12-31 23:59:59'
  9.  
  10. -- List them in ascending order
  11. ORDER BY `meta_value` ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement