Get Latest records by ab_effectivedate field and aggregate EarnCode decimal field.
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' aggregate='true'> <entity name='ab_deductionfringes'>
<attribute name='ab_effectivedate' alias='EffectiveDateYear' groupby='true' dategrouping='year'/>
<attribute name='ab_effectivedate' alias='EffectiveDateMonth' groupby='true'dategrouping='month'/>
<attribute name='ab_effectivedate' alias='EffectiveDateDay' groupby='true' dategrouping='day'/>
<attribute name='ab_earncode' alias='EarnCode' aggregate='sum' />
<order alias='EffectiveDateYear' descending='true' />
<order alias='EffectiveDateMonth' descending='true' />
<order alias='EffectiveDateDay' descending='true' />
<filter type='and'>
<condition attribute='ab_union' operator='eq' uitype='ab_union' value='" + unionId + @"' />
<condition attribute='ab_trade' operator='eq' uitype='ab_trade' value='" + tradeId + @"' />
<condition attribute='statecode' operator='eq' value='0' />
<condition attribute='ab_effectivedate' operator='not-null' />
</filter>
</entity>
</fetch>
No comments:
Post a Comment