AnsweredAssumed Answered

Help with SQL statement

Question asked by duncanbaker on Jun 7, 2014
Latest reply on Jun 8, 2014 by beverly

Hi folks

 

I've been failing miserably trying to write a SQL statement and figured I'd come seeking help... Here's the set up:

 

I want to obtain the MAX value from a related table, but only where an attribute of that table is a certain value.

 

Table 1 is INS - this will have the MAXVALUE SQL calc field

Table 2 is JIQ - this is where the numbers are held that I wish to determine the MAX from. There are multiple records in this table for each record in the INS table.

But, I only want the MAX value from the records in JIQ when the field TYPE in JIQ = "Type A"

 

Hope that makes sense. Any help, much appreciated as always.

 

Thanks

Outcomes