Compilation Error while executing Select database Query in Assist Edge Community Edition - String constant must end with double quotes



When tried to provide Select Query in Database Apps and run instance I get compilation error processing expressions “” String constant must end with double quotes, the same query executes without issues in sql editior, can you provide the fix and revert :-
"select cp.txtMasterProjectcode AS MPC,sum(isnull(numSplitValue,0)+isnull(numRevenueFreeze,0)) AS RRH
from testowner.ProFFiTTrnCPRevenueShare v (nolock)
join testowner.proffittrnChildPuCmpnyMappingDetails cp (nolock) on v.txtChildProjectCode=cp.txtChildProjectCode

          where  v.intRevenueShareVersion = (select max(v1.intRevenueShareVersion) from TESTOWNER.ProFFiTTrnCPRevenueShare v1 (nolock) 
                 where v.txtMasterProjectCode=v1.txtMasterProjectCode and v1.flgVersionStatus='A') 
                    and case when ltrim(rtrim(isnull(cp.txtGroupMasterProjectCode,'')))='' 
                                                                                               THEN cp.txtMasterProjectCode 
                                                                                               ELSE cp.txtGroupMasterProjectCode end in('X6MAFFJZ')
                        --and cp.txtReportingSubunit = 'IVS'
          group by cp.txtMasterProjectCode ,cp.txtReportingSubunit"


In the argument window create a string argument and put your query as default value. In case there is an issue with your it will be shown. Correct it by gibing escape characters