I am attempting to make use of the following query nevertheless its not receiving any records:

SELECT wp_posts.* FROM wp_posts 
INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) 
INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) 
INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) 
INNER JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id) 
WHERE ( wp_term_relationships.term_taxonomy_id IN (92) ) 
AND wp_posts.post_type = 'post' 
AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'future') 
AND wp_postmeta.meta_key = '_inicio_date' 
AND mt1.meta_key = '_inicio_date' 
AND mt2.meta_key = '_eventtimestamp' 
AND ( (mt1.meta_value BETWEEN 20110201 AND 20110231) OR (mt2.meta_value BETWEEN 20110201 AND 20110231) ) 
GROUP BY wp_posts.ID 
ORDER BY wp_posts.post_date asc  

But, Basically do:

SELECT wp_posts.* FROM wp_posts 
INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)   
INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) 
INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) 
INNER JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id) 
WHERE ( wp_term_relationships.term_taxonomy_id IN (92) ) 
AND wp_posts.post_type = 'post' 
AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'future') 
AND wp_postmeta.meta_key = '_inicio_date' 
AND mt1.meta_key = '_inicio_date' 
AND mt2.meta_key = '_eventtimestamp' 
AND (mt1.meta_value BETWEEN 20110201 AND 20110231) 
OR (mt2.meta_value BETWEEN 20110201 AND 20110231) 
GROUP BY wp_posts.ID 
ORDER BY wp_posts.post_date asc

It will get records, but ignores all of the previos "AND" for that records found with "OR"

How do i nest the final "AND" and "OR"?

Thanks

It labored by using this:

SELECT wp_posts.* FROM wp_posts 
INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) 
INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) 
LEFT JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) 
LEFT JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id) 
WHERE ( wp_term_relationships.term_taxonomy_id IN (".$categoria.") ) 
AND wp_posts.post_type = 'post' 
AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private' OR     wp_posts.post_status = 'future') 
AND ( ( mt1.meta_key = '_incio_date' AND (mt1.meta_value BETWEEN 20110201 AND 20110231) ) OR (mt2.meta_key = '_eventtimestamp' AND (mt2.meta_value BETWEEN 20110201 AND 20110231) ) )
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date asc

It appears in my experience that certain entry in wordpress_posts might not have both connected records in wordpress_postmeta table, so change

INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) 
INNER JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id) 

to

LEFT JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) 
LEFT JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id) 

Yet another factor: be cautious if you use BETWEEN:

For the best results when utilizing BETWEEN with date or time values, use CAST() to clearly convert the values towards the preferred data type. Good examples: Should you compare a DATETIME to 2 DATE values, convert the DATE values to DATETIME values. If you are using a string constant for example '2001-1-1' inside a comparison to some DATE, cast the string to some DATE.