SETRANGE Based on time

WashoutWashout Member Posts: 24
Hi,

I have a table with a TIME field in it.

I have to write a codeunit which will run as a scheduled task hourly.

So if the task runs at XX:59:59 every hour then it needs to return all rows where the TIME field in the tableis XX hours.

is this done by SETRANGE and how?

thannks in advance

Comments

  • rajpatelbcarajpatelbca Member Posts: 178
    Why cant you use job schedular for that?
    you have to use timer automation control for that.

    CP Timer automation control helps you to complete this task.
    Experience Makes Man Perfect....
    Rajesh Patel
  • krikikriki Member, Moderator Posts: 9,110
    In the other case, the code would be:

    intHour : integer
    timStart,timStop : time
    intHour := 23;
    timStart := 000000T + (23 * 60 * 60 * 1000);
    timstop := timstart + ((((59 * 60) + 59) * 1000) + 999);
    
    ...
    SETRANGE("The Time",timstart,timstop);
    ...
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.