How to get in month not date with mthofYr from TransDate to show AmountCur from AssetTrans

[SysEntryPointAttribute]
public void ProcessReport()
{

AssetTrans assettrans;
AssetGroup assetgroup;
AssetTable assettable;
AssetBook assetbook;
AssetSumCalc_Trans assetsumcalc;

TransDate periode;

AssetListFixedActiveContract contract= this.parmDataContract();

periode = contract.parmperiode();

if (periode == dateNull())
{periode = systemDateGet();}

while select assetgroup

{

tmp.clear();

select sum(AmountCur) from assettrans where assettrans.AmountCur
&& assettrans.AssetGroup == assetgroup.GroupId
&& assettrans.TransType == AssetTransType::Depreciation
&& assettrans.TransDate == periode;
tmp.AmountCur = assettrans.AmountCur;

}

How to get in month not date with mthofYr from TransDate to show AmountCur from AssetTrans

This is not clear. Can you please explain?

i make a report to show amountcur from assetgroup where assettrans.assetgroup== assetgroup.groupid
with condition
&& assettrans.TransType == AssetTransType::Depreciation
&& assettrans.TransDate == periode;

------BUT------
operand of mthofyr is integer and i want to get only month from transdate which operand is date
please help
thank you so much

You mean the start date and end date of a month? If so this has been discussed here,
dynamicsuser.net/…/class-method-transdate–1-month

@Kranthi
Sorry, the page you were looking for in this blog does not exist.

Sorry Kranthi
i want not to show about int or date
but i want to get amountcur where the parameter is transdate
but the transdate is so detail to show record in date
and i want to get amountcur from transdate which is full of month from transdate

please help
thank you so much

dynamics-ax-live.blogspot.in/…/how-to-get-first-and-last-day-of-month.html

thanks @kranthi
finally i solve about this case

[SysEntryPointAttribute]
public void ProcessReport()
{
//deklarasi table
AssetTrans assettrans;
AssetGroup assetgroup;
AssetTable assettable;
AssetBook assetbook;
AssetSumCalc_Trans assetsumcalc;
StartDate startdate;
EndDate enddate;

TransDate periode;

AssetListFixedActiveContract contract= this.parmDataContract();

periode = contract.parmperiode();
startdate = mkDate(1, mthOfYr(periode), year(periode));
enddate = endmth(periode);

if (periode == dateNull())
{periode = systemDateGet();}

while select assetgroup

{
tmp.clear();

select sum(AmountCur) from assettrans where assettrans.AmountCur
&& assettrans.AssetGroup == assetgroup.GroupId
&& assettrans.TransType == AssetTransType::Depreciation
&& assettrans.TransDate >= startdate
&& assettrans.TransDate <= enddate;
tmp.AmountCur = assettrans.AmountCur;

tmp.insert();
}
}

If any reply has helped you, please don’t forget to mark it as verified (by clicking this helped me).