Hi,
Thank you all for the responses. I solved the problem using two Date objects (from and to) and added the values into the SysQuery::Range function as follows:
/// <summary>
/// Fetch all records where the month renewal date is equal to the system date month
/// </summary>
public void getProfiles()
{
Query query;
QueryRun queryRun;
QueryBuildDataSource queryDS;
// Get current month for query range
date currentSysDate = systemDateGet();
int currentMonth = mthOfYr(currentSysDate);
int currentYear = year(currentSysDate);
date lastDateOfMonth = endmth(currentSysDate);
date firstDateOfMonth = mkDate(1, currentMonth, currentYear);
// Create Query and set the range
query = new Query();
queryDS = query.addDataSource(tableNum(RenewProfile));
SysQuery::findOrCreateRange
(queryDS,fieldNum(RenewProfile, NextRenewDate))
.value(strFmt("%1..%2", firstDateOfMonth, lastDateOfMonth));
// Run query and process result set
queryRun = new queryRun(query);
while (queryRun.Next())
{
profiles = queryRun.get(tableNum(RenewProfile));
this.insertARRTransactionRecords(profiles.MembershipNumber);
info(profiles.MembershipNumber);
}
}