Hi
I am trying to put the result of a subquery in a varible using 'expression' feature in peoplesoft query (version 8.4). i get a nasty sql error. if i use a database field instead of the variable it works. can u please tell if i am doing anything wrong here.
code:
SELECT A.BUSINESS_UNIT, AMOUT1
FROM PS_LEDGER A
WHERE A.BUSINESS_UNIT = '00231'
AND AMOUT1 = (SELECT C.POSTED_TOTAL_AMT
FROM PS_LEDGER C
WHERE A.ACCOUNT = '7110')
In this code i defined 'Amount1' as a number in 'expression' feature.
If i use the database field instead of 'Amount1' variable code will be like this.
SELECT A.BUSINESS_UNIT, A.POSTED_TOTAL_AMT
FROM PS_LEDGER A
WHERE A.BUSINESS_UNIT = '00231'
AND A.POSTED_TOTAL_AMT = (SELECT C.POSTED_TOTAL_AMT
FROM PS_LEDGER C
WHERE A.ACCOUNT = '7110')
thanks
Sreedevi
I am trying to put the result of a subquery in a varible using 'expression' feature in peoplesoft query (version 8.4). i get a nasty sql error. if i use a database field instead of the variable it works. can u please tell if i am doing anything wrong here.
code:
SELECT A.BUSINESS_UNIT, AMOUT1
FROM PS_LEDGER A
WHERE A.BUSINESS_UNIT = '00231'
AND AMOUT1 = (SELECT C.POSTED_TOTAL_AMT
FROM PS_LEDGER C
WHERE A.ACCOUNT = '7110')
In this code i defined 'Amount1' as a number in 'expression' feature.
If i use the database field instead of 'Amount1' variable code will be like this.
SELECT A.BUSINESS_UNIT, A.POSTED_TOTAL_AMT
FROM PS_LEDGER A
WHERE A.BUSINESS_UNIT = '00231'
AND A.POSTED_TOTAL_AMT = (SELECT C.POSTED_TOTAL_AMT
FROM PS_LEDGER C
WHERE A.ACCOUNT = '7110')
thanks
Sreedevi