Hi,
I am having an issue with trying to subtract from the today( ) in the where clause of a SELECT statement.
I am using the SalesLine to get the warehouse in InventDim, which is then used to get the number of days in the past in a custom table. This number of days is used to subtract from today's date to determine whether to process or not. It is of type Integer, has no EDT, and has the value 14.
The sample code is below, and if I substitute the field for the number of days in the past by hardcoding, it works. Are you not allowed to subtract a integer field value from today( )?
Thanks in advance!
SalesLine salesLine;
InventDim inventDim;
myCustomParmTable customParmTable; // has two fields: InventLocationId, NumDaysInPast (type Integer; value = 14)
SalesId _salesId = 'SO-00001001';
;
while select salesLine
where salesLine.SalesId == _salesId
join inventDim
where inventDim.inventDimId == salesLine.InventDimId
join customParmTable
where customParmTable.InventLocationId == inventDim.InventLocationId &&
salesLine.ConfirmedDlv >= today() - 14 // <-- this goes in loop
// salesLine.ConfirmedDlv >= today() - customParmTable.NumDaysInPast // <-- this doesn't go in loop
{
// process SO line
info("Inside while loop");
}