Skip to Content

How to use parameters of sub query in SAP Crystal report?.

Hi all,

I have query (main query) which has sub query, main query and sub query have parameters, so I want to put that query in SAP Crystal report command but I do know how I can use parameters in sub query in SAP Crystal report.

Below is my query

SELECT T1.[Debit], T1.[Credit], T1.[ProfitCode],T2.[ActId], T0.[Memo], T2.[AcctName], T3.[OcrName],T0.[RefDate] , (select sum(T5.[Debit]) - sum(T5.[Credit]) as openingbalance from OJDT T4 INNER JOIN JDT1 T5 ON T4.[TransId] = T5.[TransId] where T4.[RefDate]>=[%3] and T4.[RefDate]<[%0] and T5.[ProfitCode]=T1.[ProfitCode]) FROM OJDT T0 INNER JOIN JDT1 T1 ON T0.[TransId] = T1.[TransId] INNER JOIN OACT T2 ON T1.[Account] = T2.[AcctCode] INNER JOIN OOCR T3 ON T1.[ProfitCode] = T3.[OcrCode] WHERE T1.[ProfitCode] <>'' AND T0.[RefDate] >=[%0] AND T0.[RefDate] <=[%1] AND T3.[OcrName] =[%2]

Please anyone can help me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 19, 2017 at 02:50 PM

    You'll do the parameters to the sub-query just like to the main query. See my blog post for information about how to work with parameters in a Command:


    Add comment
    10|10000 characters needed characters exceeded