Recently, I have been trying to use select_sql free format to run a SQL query. It is working well and the data is display to the web but I have 2 problem.
1)The edit mask that I assign to the field is not working and the result will have leading zero.
2)It will add one more entry at the end of the list which is not in the result (see entry below W.P Kuala Lumpur).
this is the field definition :
this is the code I use in server module :
Code: Select all
Srvroutine Name(Getdata2)
List_Map For(*OUTPUT) List(#TestList)
Define Field(#SQLQUERY) Type(*CHAR) Length(2500)
#SQLQUERY := 'select dbo.UF_GET_STATE_DESC(account_master.branch_code), sum(resit_amount), sum((case when type = ''C'' AND upper(substring(bis_no,1,1)) <> ''M'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''MBB'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''RHB'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''P'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''BSN'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(bis_no,1,3) = ''BMM'' then resit_amount else 0 end)), sum((case when type = ''T'' and substring(isnull(bis_no, ''N/A''),1,3) not in(''BMM'',''BSN'',''POS'',''RHB'',''MBB'') then resit_amount else 0 end)) from dbo.resit2, dbo.account_master where (dbo.resit2.account_no = dbo.account_master.account_no) and (dbo.resit2.trx_date >= ''2017-06-01'') and (dbo.resit2.trx_date <= ''2017-06-06'') and (dbo.resit2.cncl_status not in (''X'',''R'')) and (dbo.resit2.vld_status = ''Y'') GROUP BY dbo.UF_GET_STATE_DESC(account_master.branch_code) ORDER BY dbo.UF_GET_STATE_DESC(account_master.branch_code) ASC'
Select_Sql Fields(#PC_NEGERI #PC_TOTAL #PC_CEK #PC_MBB #PC_RHB #PC_POS #PC_BSN #PC_BMMB #PC_TUNAI) From_Files((ACCOUNT_MASTER)(RESIT2)) Using(#SQLQUERY)
Add_Entry To_List(#TestList)
Endselect
EndroutineCode: Select all
Evtroutine Handling(#Com_owner.Initialize)
#com_owner.test
Endroutine
Mthroutine Name(test)
Define_Com Class(#DWHPaymentTestSRV.GetData2) Name(#Find)
#Find.ExecuteAsync( #List1 )
Evtroutine Handling(#Find.Completed)
Add_Entry To_List(#List1)
Endroutine
Endroutine