Hi All,
I have a code that goes
I have a new request to give the user the option to choose all date as well as the last 30 days. I know I can use a dynamic query to do this. However I'd like to avoid re-writing the program if this is possible. Is there any way I can alter the FOR EACH to do this.
I was thinking something like
I'm not sure if the above will work correctly or if it will cause big performance impact, on the search give the fields depot-num and last-update are an index. I'd appreciate any guidance on this.
I have a code that goes
Code:
ASSIGN dtLastUpdate = TODAY - 30.
FOR EACH ORDER WHERE depot-num = currentDepot
AND last-update >= dtLastUpdate NO-LOCK:
EXPORT ORDER.
END.
I have a new request to give the user the option to choose all date as well as the last 30 days. I know I can use a dynamic query to do this. However I'd like to avoid re-writing the program if this is possible. Is there any way I can alter the FOR EACH to do this.
I was thinking something like
Code:
ASSIGN dtLastUpdate = TODAY - 30.
FOR EACH ORDER WHERE depot-num = currentDepot
AND (IF chOptionChosen = "All" THEN TRUE
ELSE last-update >= dtLastUpdate)
NO-LOCK:
EXPORT ORDER.
END.