WHERE date_column BETWEEN STR_TO_DATE('2010-12-10', '%Y-%m-%d') AND STR_TO_DATE('2010-12-15', '%Y-%m-%d')
Sådan?
EDIT:glemte et afsluttende citat. ups
EDITv2:Tilføjelse af din kode med den opdaterede forespørgsel
EDITv3:lidt optimering fjernet 1=1 sammenligning, bruger IN() til wp_posts.post_status
SELECT SQL_CALC_FOUND_ROWS wp_posts.*
FROM wp_posts
JOIN wp_postmeta
ON (wp_posts.ID = wp_postmeta.post_id)
WHERE wp_posts.post_type = 'post'
AND (wp_posts.post_status IN ('publish','private'))
AND wp_postmeta.meta_key = 'expiry_date'
AND ___INSERT_NAME_OF_DATE_COLUMN_HERE___
BETWEEN STR_TO_DATE('2010-12-05', '%Y-%m-%d')
AND STR_TO_DATE('2010-12-15', '%Y-%m-%d')
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 100