Thanks to Peter Strain and Robert Crossley for their suggested solutions
and to Karl Kliparchuk for his suggestion that I use Discover.

This was how I stated my problem :

I am trying to "get my head around" this problem.  I have two tables of
down-hole data.

The first " Assay Results" is of the form (has these fields)

HoleID,From,To,sampleNo,Znppm

being respectively, the hole number, the from depth, the to depth, the
laboratory sample number and zinc concentration in ppm.

The second table "dhsusc" is of the form (has these fields)

HoleID, At, Magsus

being respectively the hole number, the depth at which the reading was
taken, and the magnetic susceptibility.

Typically Magsus has been measured at 10 cm intervals whereas the assays
are over intervals of about 1 to 2 metres.

I wish to determine averages, maxima and minima for Magsus within the Assay
intervals.

These are the relevant parts of the tab files upon which I attempted the
solutions

Assay_results.tab
     HoleID Char (15) Index 1 ;
     From Float ;
     To Float ;
     SampleNo Char (10) ;
     Zn_ppm Float ;

SM_1020C-1MI_copy.tab
     HoleID Char (6) Index 1 ;
     Atdepth Float ;
      __mV__ Float ;

Peter Strain's suggested solution translated to this, entered at the SQL
dialogue box but here presented copied from the Map basic window.

Select Assay_results.HoleID, Assay_results.From, Assay_results.To,
Assay_results.SampleNo, Assay_results.Zn_ppm, Min(SM_1020C_1MI_copy.
__mV__),Max(SM_1020C_1MI_copy.__mV__), Avg(SM_1020C_1MI_copy.__mV__)
from SM_1020C_1MI_copy, Assay_results
where SM_1020C_1MI_copy.HoleID=Assay_results.HoleID
And SM_1020C_1MI_copy.Atdepth >Assay_results.From
And SM_1020C_1MI_copy.Atdepth <Assay_results.To
group by
Assay_results.HoleID,Assay_results.From,Assay_results.To,Assay_results.SampleNo,Assay_results.Zn_ppm


into Selection

This apparently worked perfectly first time, I trust the averages maxima
and minima are correct (in other words have not worked them out some other
way).  Rather than tempt fate, I chose, on Peter's advice to change the
name of the 'Atdepth' field from 'At' before starting. The field names
'From' and 'To' did not cause problems.

Robert Crossley's solution was tried by editing Peter Strain's solution to
Select Assay_results.HoleID, Assay_results.From, Assay_results.To,
Assay_results.SampleNo, Assay_results.Zn_ppm, Min(SM_1020C_1MI_copy.
__mV__),Max(SM_1020C_1MI_copy.__mV__), Avg(SM_1020C_1MI_copy.__mV__) from
Assay_results, SM_1020C_1MI_copy where
Assay_results.HoleID=SM_1020C_1MI_copy.HoleID And SM_1020C_1MI_copy.Atdepth
Between Assay_results.From And Assay_results.To group by
Assay_results.HoleID,Assay_results.SampleNo into Selection

Again, rather than tempt fate I took the liberty of altering Robert's
suggested 'Av(SM_1020_1MI_copy.__mV__)' to 'Avg(SM_1020_1MI_copy.__mV__)'
{Av may work, I do not know, sorry for the lack of faith}.
Robert's method as set out above also worked apparently first time.

Both solutions are imho largely similar, the grouping element of Robert's
is less complex and his Between function is less typing intensive than
Peter's.

My gratitude to all who replied

Regards Brendan O'Donovan Snr Geologist Tara Mines Ireland.

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to