Hi all,
One month before i posted one post : //community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/429370/regarding-complex-sql
Mr.martin helped but unfortunately that SQL step failed and its some sync issue came.
I skipped that steps now and i will do temp table steps.
Table name : TPL_SummaryCTC
Fields : From date and to date, amountCur.
My new temp table : TPL_SummaryCTCTmp
Fields : Jan, feb,mar,,,,,,,,,Dec, total salary.(13 fields).
below my code:
public server static void TempData(TPL_SummaryCTCTmp _tmp)
{
TPL_SummaryCTC summaryCTC;
TPL_SummaryCTCTmp tmp;
delete_from tmp;
select sum(AmountCur) from summaryCTC
where summaryCTC.FromDate >= datestratMth(mkdate(1,1,2021)
&& summaryCTC.ToDate <= dateEndmth(mkdate(31,1,2021);
summaryCTC.AmountCur = tmp.Jan;
summaryCTC.insert();
select sum(AmountCur) from summaryCTC
where summaryCTC.FromDate >= datestratMth(mkdate(1,2,2021)
&& summaryCTC.ToDate <= dateEndmth(mkdate(28,2,2021);
summaryCTC.AmountCur = tmp.Feb;
summaryCTC.insert();
}
As shown the code above, i want without hard code how to do datestartmonth and endMonth ? don't want current date.
2. 12 select statement need for that ? if so, how to do in12 select statement all month insert ? i did one by one insert.
Could you please give me example for that.
Thanks