Hey,
I have simple requirements i need to select records created greater than X date.
I am trying to do that via x query but i have a problem when i add a range value it becomes "1900-01-01T00:00:00" but value was setting diffrent than that date.
There is how i trying to do:
Query query;
QueryRun queryRun;
QueryBuildDataSource qbdsPurch,qbdsPurchLine;
utcdatetime utcTime;
str timestr;
query = new Query();
qbdsPurch = query.addDataSource(tableNum(PurchTable));
qbdsPurchLine = qbdsPurch.addDataSource(tableNum(PurchLine));
qbdsPurchLine.joinMode(JoinMode::InnerJoin);
qbdsPurchLine.addLink(fieldNum(PurchTable,PurchId),fieldNum(PurchLine, PurchId));
qbdsPurchLine.addSortField(fieldNum(PurchLine,PurchId));
qbdsPurch.addRange(fieldNum(PurchTable,PurchaseType)).value(enum2Str(PurchaseType::Purch));
qbdsPurch.addRange(fieldNum(PurchTable,PurchStatus)).value(enum2Str(PurchStatus::Backorder));
utcTime = DateTimeUtil::getToday(TimeZone::GMTPLUS0300ISTANBUL);
timestr = DateTimeUtil::toStr(utcTime);
qbdsPurch.addRange(fieldNum(PurchTable,CreatedDateTime)).value(strfmt(" >= %1",timestr));
i am watching values on debug and utcTime value is {09/15/2022 00:00:00}
timeStr > "2022-09-15T00:00:00"
and qbdsPurch > {SELECT * FROM PurchTable(PurchTable_1) WHERE ((PurchaseType = 3)) AND ((PurchStatus = 1)) AND ((createdDateTime = '1900-01-01T00:00:00')) JOIN * FROM PurchLine(PurchLine_1) ORDER BY PurchLine.PurchId ASC ON PurchTable.PurchId = PurchLine.PurchId}
Why this createdDateTime becomes equal to null ? Any helps


Report
All responses (
Answers (