Dynamics ax 2012: Sample code for fetching records in tmp table using query and Insert record set
public static server void constructData(ASMARMatricsReportingTmp _tmp, TransDate _asOfDate, TransDate _startDate, ...