What am I doing wrong in this query? I want to select events from a custom post type called events and order by the event date and only show ones after the current date. It doesn't seem to work...
$querystr = "
SELECT $wpdb->posts.*
FROM $wpdb->posts, $wpdb->postmeta
WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
AND $wpdb->postmeta.meta_key = 'wpcf-start-date'
AND $wpdb->postmeta.meta_value >= CURDATE()
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'events'
ORDER BY $wpdb->postmeta.meta_value ASC
";
WP_QUERY? – Miha Rekar Oct 12 '12 at 13:39