Group by / Having Query with Master Table

techstar

Member²
For a test I set up two tOracleDataset queries using the Scott schema as follows:

Q1. select * from scott.dept
Q2. select empno,max(hiredate) from
scott.emp
where deptno = :deptno
group by empno
having empno > 7900
order by empno

Q2.Master = Q1 and MasterFields= DEPTNO

I understand that these may not be "proper", but they are technically correct and were built as a test.

Q1 works. However, Q2 has some strange behavior. It works when in the SQL editor (CTRL-R). However, if you attempt to set it active either manually or programmatically, it comes back with a message: Field 'DEPTNO' not found.

What is the problem?

------------------
Perry Schwartz
TechStar International

[This message has been edited by techstar (edited 17 January 2000).]

[This message has been edited by techstar (edited 17 January 2000).]
 
The MasterFields property can only contain fieldnames that are present in the detail dataset. In other words: you need to include the DEPTNO column in the select list of the detail dataset. You probably want to make this field invisible, as you don't really need it.

This restriction will be removed in a furure release.

------------------
Marco Kalter
Allround Automations
 
Back
Top