unknown
2009-12-22 17:04:44 UTC
I am trying to develop a treeview report with retrieval
paramaters with the following SQL as the data source:
SELECT DISTINCT
rnt_account.account_no,
rnt_account_totals.balance,
rnt_account.account_status,
LBR_Rent_Account_Parties (rnt_account.account_no)
Account_Parties,
SO_VIEW.Single_Occupancy,
D_VIEW.Age,
SUBSTR(
NVL2(PAV.property_addr_line1,PAV.property_addr_line1||'
','')||
NVL2(PAV.property_addr_line2,PAV.property_addr_line2||'
','')||
NVL2(PAV.property_addr_line3,PAV.property_addr_line3||'
','')||
NVL2(PAV.property_addr_line4,PAV.property_addr_line4||'
','')||
NVL2(PAV.property_post_code,property_post_code,''),1,125)
Property_Address,
SUBSTR(
NVL2(E.correspondence_addr_line1,E.correspondence_addr_line1||'
','')||
NVL2(E.correspondence_addr_line2,E.correspondence_addr_line2||'
','')||
NVL2(E.correspondence_addr_line3,E.correspondence_addr_line3||'
','')||
NVL2(E.correspondence_addr_line4,E.correspondence_addr_line4||'
','')||
NVL2(E.correspondence_addr_post_code,E.correspondence_addr_post_code
,''),1,125) Correspondence_Address,
rnt_property.area_code,
rnt_area.area_description Area_Description,
rnt_account.acnt_arrears_status,
rnt_property.patch_code,
rnt_patch.patch_description Patch_Description ,
rnt_account.cease_date
FROM rnt_account,
rnt_account_totals,
rnt_property,
rnt_area,
rnt_patch,
lbr_property_address_view PAV,
lbr_tenant_correspondence_view E,
(SELECT ROV.account_no,
(CASE count(*)
WHEN 1 THEN 'Y'
ELSE 'N'
END) Single_Occupancy
FROM rnt_occupants_view ROV
WHERE 1=1
GROUP BY ROV.account_no) SO_VIEW,
(
SELECT ROV.account_no,
(CASE TO_CHAR(person.date_of_birth,'DD-MM-YYYY')
WHEN '01-01-1800' THEN 'N/A'
ELSE TO_CHAR(person.date_of_birth,'DD-MM-YYYY')
END) D_O_B,
(CASE
WHEN TO_CHAR(person.date_of_birth,'DD-MM-YYYY') <>
'01-01-1800' THEN
SUBSTR(TO_CHAR(ABS(ROUND(Months_between(person.date_of_birth
,sysdate) /12,1))),1,2)
ELSE 'N/A'
END) Age,
RANK() OVER(PARTITION BY ROV.account_no ORDER BY
person.pin ASC) Ranking
FROM rnt_occupants_view ROV,
person
WHERE 1=1
AND ROV.pin = person.pin
AND ROV.party = 'Y'
) D_VIEW
WHERE 1=1
AND rnt_account.account_no =
rnt_account_totals.account_no
AND rnt_account.account_no = SO_VIEW.account_no
AND rnt_account.account_no = D_VIEW.account_no
AND D_VIEW.Ranking = 1
AND rnt_account.uprn = rnt_property.uprn
AND rnt_property.area_code = rnt_area.area_code
AND rnt_property.patch_code = rnt_patch.patch_code
AND rnt_account.uprn = PAV.uprn
AND rnt_account.account_no = E.rent_account_no
AND rnt_account.account_status= 'F'
AND rnt_account_totals.balance > 0.00
ORDER BY 2 DESC
However, I get an error message in Infomaker as follows:
Cannot apply criteria to a select statement with union or
nested select or nested report.
I have seen this error before when I have had Unions in SQL
queries, however, as far as I can seen the SQL does not
include any Union or Nested Select, nor am I using a nested
report. So why is this error occuring?
We are using Infomaker 10.5.1 Build 6662 with the Northgate
OHMS Oracle database.
Any assistance would be appreciated
paramaters with the following SQL as the data source:
SELECT DISTINCT
rnt_account.account_no,
rnt_account_totals.balance,
rnt_account.account_status,
LBR_Rent_Account_Parties (rnt_account.account_no)
Account_Parties,
SO_VIEW.Single_Occupancy,
D_VIEW.Age,
SUBSTR(
NVL2(PAV.property_addr_line1,PAV.property_addr_line1||'
','')||
NVL2(PAV.property_addr_line2,PAV.property_addr_line2||'
','')||
NVL2(PAV.property_addr_line3,PAV.property_addr_line3||'
','')||
NVL2(PAV.property_addr_line4,PAV.property_addr_line4||'
','')||
NVL2(PAV.property_post_code,property_post_code,''),1,125)
Property_Address,
SUBSTR(
NVL2(E.correspondence_addr_line1,E.correspondence_addr_line1||'
','')||
NVL2(E.correspondence_addr_line2,E.correspondence_addr_line2||'
','')||
NVL2(E.correspondence_addr_line3,E.correspondence_addr_line3||'
','')||
NVL2(E.correspondence_addr_line4,E.correspondence_addr_line4||'
','')||
NVL2(E.correspondence_addr_post_code,E.correspondence_addr_post_code
,''),1,125) Correspondence_Address,
rnt_property.area_code,
rnt_area.area_description Area_Description,
rnt_account.acnt_arrears_status,
rnt_property.patch_code,
rnt_patch.patch_description Patch_Description ,
rnt_account.cease_date
FROM rnt_account,
rnt_account_totals,
rnt_property,
rnt_area,
rnt_patch,
lbr_property_address_view PAV,
lbr_tenant_correspondence_view E,
(SELECT ROV.account_no,
(CASE count(*)
WHEN 1 THEN 'Y'
ELSE 'N'
END) Single_Occupancy
FROM rnt_occupants_view ROV
WHERE 1=1
GROUP BY ROV.account_no) SO_VIEW,
(
SELECT ROV.account_no,
(CASE TO_CHAR(person.date_of_birth,'DD-MM-YYYY')
WHEN '01-01-1800' THEN 'N/A'
ELSE TO_CHAR(person.date_of_birth,'DD-MM-YYYY')
END) D_O_B,
(CASE
WHEN TO_CHAR(person.date_of_birth,'DD-MM-YYYY') <>
'01-01-1800' THEN
SUBSTR(TO_CHAR(ABS(ROUND(Months_between(person.date_of_birth
,sysdate) /12,1))),1,2)
ELSE 'N/A'
END) Age,
RANK() OVER(PARTITION BY ROV.account_no ORDER BY
person.pin ASC) Ranking
FROM rnt_occupants_view ROV,
person
WHERE 1=1
AND ROV.pin = person.pin
AND ROV.party = 'Y'
) D_VIEW
WHERE 1=1
AND rnt_account.account_no =
rnt_account_totals.account_no
AND rnt_account.account_no = SO_VIEW.account_no
AND rnt_account.account_no = D_VIEW.account_no
AND D_VIEW.Ranking = 1
AND rnt_account.uprn = rnt_property.uprn
AND rnt_property.area_code = rnt_area.area_code
AND rnt_property.patch_code = rnt_patch.patch_code
AND rnt_account.uprn = PAV.uprn
AND rnt_account.account_no = E.rent_account_no
AND rnt_account.account_status= 'F'
AND rnt_account_totals.balance > 0.00
ORDER BY 2 DESC
However, I get an error message in Infomaker as follows:
Cannot apply criteria to a select statement with union or
nested select or nested report.
I have seen this error before when I have had Unions in SQL
queries, however, as far as I can seen the SQL does not
include any Union or Nested Select, nor am I using a nested
report. So why is this error occuring?
We are using Infomaker 10.5.1 Build 6662 with the Northgate
OHMS Oracle database.
Any assistance would be appreciated