Hi Community, getting crazy. This have worked earlier.
Got this first to get the highest nuber from a time field in database:
Load NUM(MAXTID) as MAXTID; SELECT max(R2PTIM) as MAXTID from TABLE where R2CMP = '222' and R2PDAT >= current_date; LET VLastUp = MAXTID;
Load NUM(MAXTID) as MAXTID; SELECT max(R2PTIM) as MAXTID from CLICFILPRD.RKNRP200 where R2CMP = '222' and R2PDAT >= current_date; LET VLastUp = MAXTID; in variable
Then i want to use this VLastUp in the next SQL in script:
SELECT * from Table where R2CMP = '222' and R2PDAT >= current_date and R2PTIM > '$(VLastUp)';
Just want to store the highest time in Variable, then nest reolad, just show me the post with higher time than the last time and so on
The syntax you posted is correct and it should work, provided VLastUp and R2PTIM have the same format, else the condition will never be met and the results returned would not be the expected ones.
Make sure VLastUp displays its value with the same format than R2PTIM. You can use TRACE '$(VLastUp)'; in your script to see the format it takes when the script runs and troubleshoot.