I have a process report that needs to consider the point of time it is run in order to set the correct filters.
I have written the following:
IF TIME >= 00:00:01 THEN
SETRANGE("Posting Date",CALCDATE('-1D',WORKDATE))
ELSE
SETRANGE("Posting Date",WORKDATE);
The point is that when the report is run after midnight, then it needs to filter on yesterdays posting date.
However, I have no idea how I find out if time is after midnight, as Time is of datatype Time and 00:00:01 is considered as an integer.
Any idea how I find after midnight?
Thanks
Ann
0
Comments
use IF TIME > 000000T THEN
000000T = 0:00:00
101555T = 10:15:55
Dates
231206D = 23 12 2006
I have worked it out now
but when is time NOT after midnight?
//Pelle
I'll bet she has a definition for that
Whenever will the condition TIME > 000000T not be true ?
Actually you must test not test on, whether you pass midnight, but whether the NowTime is less than you ProcessStartTime, i.e.:
When again, this code only helps you partly: You will need to reconsider, if your process is delayed and started after midnight - nor if your process does continue over several days...
Thoms Hviid Thorn