SET @SQLQuote = char(39)
SET @Comp_ID = '{?Comp_ID}'
SET @Periode = '{?Periode}'
SET @prd = {?Prd}
SET @SQLParamValue = '{?SQLParamValue}'
SET @SQLParam = '{?SQLParam}'
SET @SQLParamResult = ' AND ' + @SQLParam + ' = ' + @SQLQuote + @SQLParamValue + @SQLQuote
if(@SQLParamValue = '')
SET @SQLParamResult = ''
SET @sqlCommand = 'SELECT a.login_id,a.DS_Code, b.Plus_Minus, b.Taxed, b.DS_Desc, a.Curr_ID, b.DS_Urutan, SUM(a.Amount) As Amount , d.Nama_Divisi, e.Dept_Name, c.ID_Divisi, c.Dept_ID, ' +'''+ IDR +'''+ 'As Curr_ID
FROM PrSalary a
INNER JOIN Pr_DetailSalary b ON a.Comp_ID=b.Comp_ID AND a.DS_Code=b.DS_Code
INNER JOIN Tbl_Prl_General_Info c ON a.Comp_ID=c.Comp_ID AND a.Login_ID=c.Login_ID
INNER JOIN Divisi d ON c.Comp_ID=d.Comp_ID AND c.ID_Divisi=d.ID_Divisi
INNER JOIN TDept e ON c.Comp_ID=e.Comp_ID AND c.ID_Divisi=e.ID_Divisi AND c.Dept_ID=e.Dept_ID
WHERE a.Comp_ID=' + @SQLQuote + @Comp_ID + @SQLQuote + ' AND a.Periode=' + @Periode + ' AND a.Prd='+ @prd +'
'+ @SQLParamResult +'
GROUP BY a.login_id,a.DS_Code, b.Plus_Minus, b.Taxed, b.DS_Desc, a.Curr_ID, b.DS_Urutan ,d.Nama_Divisi, e.Dept_Name, c.ID_Divisi, c.Dept_ID
ORDER BY a.login_id, b.DS_Urutan'
i just know in SQL, so try to understand your issue. i think you can do something like this: ---------------------------- select a.field_a, a.field_b, b.field_a, b.field_c, ..., penerimaan=if(table.plusminus='+', command.ds_desc, ''), potongan=if(table.plusminus='-', command.ds_desc,''), c.field_a, ..., d.field_a, etc., etc. from ..... ----------------------------------------------- in this case CR will read those fields (penerimaan and potongan) from the Dataset.
Joined: 31 Oct 2012
Location: Indonesia
Online Status: Offline
Posts: 5
Posted: 27 Dec 2012 at 10:10pm
Originally posted by Emir_W
hi Chasingrainbow,i just know in SQL, so try to understand your issue.i think you can do something like this:----------------------------select a.field_a, a.field_b, b.field_a, b.field_c, ..., penerimaan=if(table.plusminus='+', command.ds_desc, ''), potongan=if(table.plusminus='-', command.ds_desc,''), c.field_a, ..., d.field_a, etc., etc.from.....-----------------------------------------------in this case CR will read those fields (penerimaan and potongan) from the Dataset.hope it help.
thanks for reply mr emir, follow your idea, but the result still got a blank column.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum