I'm trying to resolve records from one table but correlate it's parent record into a query for the date range.
The relative fields in this case are:
My current query is:
select a.column_data, sum(a.occurrences) as countEvents from
select Event as column_data, count(*) as occurrences from TableB WHERE `RegionID` = '6' group by Event
group by a.column_data;
Event has common entries so can be counted.
What I need to do is look up RecordID from TableA and get it to search between a date range, say
DateFrom >= '2014-09-01' AND `DateTo` <= '2015-08-31'
Can someone assist me with writing the query to work for what I'm after?