hello,
i have the following sql :
---------------------------------------------------
SELECT D.BRCH_CODE,D.CACC_NUM
FROM BBSD_INTEREST_D D
WHERE INTD_DATE = '20/05/2004'
AND (SELECT MIN(INTD_DATE) FROM BBSD_INTEREST_D M
WHERE M.CACC_NUM = D.CACC_NUM
AND M.BRCH_CODE = D.BRCH_CODE)<LAST_DAY(ADD_MONTHS(D.INTD_DATE,-1))
AND (SELECT COUNT(*)
FROM BBSD_INTEREST_D I
WHERE I.CACC_NUM = D.CACC_NUM
AND I.BRCH_CODE = D.BRCH_CODE
AND I.INTD_DATE = (SELECT LAST_DAY(MIN(INTD_DATE)) FROM BBSD_INTEREST_D M
WHERE M.CACC_NUM = D.CACC_NUM
AND M.BRCH_CODE = D.BRCH_CODE))=0
---------------------------------------------------
when i run the above select statement from sqlplus, it works fine , but when i compile it from Reports6i builder
i get the error :
"
ERROR 103 at line xx, column xx
Encountered the symbol "SELECT" when expecting one of the following, etc,etc,etc
"
please note that the cursor is pointing to the SELECT statement after the AND operator.
please advise
tx in advance
i have the following sql :
---------------------------------------------------
SELECT D.BRCH_CODE,D.CACC_NUM
FROM BBSD_INTEREST_D D
WHERE INTD_DATE = '20/05/2004'
AND (SELECT MIN(INTD_DATE) FROM BBSD_INTEREST_D M
WHERE M.CACC_NUM = D.CACC_NUM
AND M.BRCH_CODE = D.BRCH_CODE)<LAST_DAY(ADD_MONTHS(D.INTD_DATE,-1))
AND (SELECT COUNT(*)
FROM BBSD_INTEREST_D I
WHERE I.CACC_NUM = D.CACC_NUM
AND I.BRCH_CODE = D.BRCH_CODE
AND I.INTD_DATE = (SELECT LAST_DAY(MIN(INTD_DATE)) FROM BBSD_INTEREST_D M
WHERE M.CACC_NUM = D.CACC_NUM
AND M.BRCH_CODE = D.BRCH_CODE))=0
---------------------------------------------------
when i run the above select statement from sqlplus, it works fine , but when i compile it from Reports6i builder
i get the error :
"
ERROR 103 at line xx, column xx
Encountered the symbol "SELECT" when expecting one of the following, etc,etc,etc
"
please note that the cursor is pointing to the SELECT statement after the AND operator.
please advise
tx in advance