[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Using Group By & Having Criteria in an SQR
- Subject: Using Group By & Having Criteria in an SQR
- From: Joanne Szewczuk <joannes@NAIT.AB.CA>
- Date: Wed, 7 Oct 1998 15:34:05 -0600
Hi everyone, I am an extremely new SQR user ( the only training I have is
what I recieved in the PeopleSoft SQL/SQR course).
I have written a simple SQR but I keep getting the following error message:
"The column prefix 'D' does not match with a table name or alias used in
the query." I have narrowed it down to the "D" alias used in my Group By
and Having criteria in the subquery.
This is part of my code:
...WHERE A.EMPLID IN (SELECT D.EMPLID
FROM PS_ADM_APPL_DATA D,
PS_ADM_APPL_PROG E
WHERE D.EMPLID = E.EMPLID
AND D.ADM_APPL_NBR =
E.ADM_APPL_NBR
AND E.PROG_ACTION =
'MATR'
AND E.ADM_APPL_NBR <>
' '
AND E.ADMIT_TERM = $TERM
GROUP BY D.EMPLID HAVING COUNT(DISTINCT(D.ADM_APPL_NBR))
>= 2)
I am using PeopleSoft Student Administration System version 7.0 with SQL
Server 6.5.
My code does run correctly when run in SQL.
Does SQR not support Group By and Having? Help!
Thank you in advance.
Joanne Szewczuk
Edmonton, Alberta, Canada