OrderService orderService = (OrderService)User.GetService(DfpService.v201208.OrderService);
// Sets defaults for page and Statement.
OrderPage page = new OrderPage();
int offset = 0;
int startCount = 0;
int endCount = 0;
int limit = 500;
//DownloadDateTime = System.DateTime.Now - 1 hour
Statement statement = new StatementBuilder(string.Format("WHERE lastModifiedDateTime >= :lastModifiedDateTime ORDER BY id LIMIT 500 OFFSET {0}", offset)).AddValue("lastModifiedDateTime", DateTimeUtilities.FromDateTime(DownloadDateTime)).ToStatement();
// Get orders by Statement.
page = orderService.getOrdersByStatement(statement);
Statement statement = new StatementBuilder(string.Format("ORDER BY id LIMIT 500 OFFSET {0}", offset)).ToStatement();
Hello:
This is a known issue that we are working on. For now the workaround is to not use bind variables:
"WHERE lastModifiedDateTime >= :lastModifiedDateTime"
so instead of ":lastModifiedDateTime", put the date directly into the query as a string. Let me know if that works.
Thanks,
Vincent Tsao, DFP API Team