I have a database with tables of data pertaining to drill holes. The data are separated into different tables grouped by the type of data collected and generally these data are linked by the hole number and depth.
In one table, each row represents data collected from sequential 3 metre intervals;
hole_id, from, to, rock_type
hole1, 3, 6, granite
hole1, 6, 9, shale
Hole1, 9, 12, shale
In a second table, each row represents data collected from sequential 1 metre intervals;
Hole_ID, From, to, Number_of_fractures
hole1, 3, 4, 3
hole1, 4, 5, 1
hole1, 5, 6, 2
I need to create a query which will find the total number of fractures in each interval in table 1. For the example above, in table 1 the interval is 3-6 metres and the corresponding number of fractures from table 2 would be 6.
All I have figured out so far is to create a query which extracts the hole_id, from, to from the 3 m interval table. I cannot figure out how to get access to sum the values from table 2 that fall within these depth ranges.
Thanks in advance,
Ama