Page 1 of 1

[RPG/JS] Example of TODAY function

Posted: Tue Jun 13, 2017 1:08 pm
by mwilliams
I was wondering if someone could provide an example of using &(F:TODAY()) with a formatting option. I've tried using it to set a variable with no luck. In the following case the variable today is null. I've tried with a date format and without.

Code: Select all

lrexec (
   function () {
      this.q_sql("?today = SELECT &(F:TODAY('yyyyMMdd'))");
   },

   function () {
      this.q_receiveVars("today");
   },

   function () {
      this.console(this.today);
   },

   null
);

Re: [RPG/JS] Example of TODAY function

Posted: Tue Jun 20, 2017 12:32 pm
by tsupartono
Apology for the late response.
This sounds like a bug to me, can you please log a bug report with LANSA Support? Thanks.

Re: [RPG/JS] Example of TODAY function

Posted: Fri Jun 30, 2017 11:35 am
by jasonzhou
We've updated our app on the store. In the latest version, there is a TODAY(...) sql function which returns the current date with the specified formatting option.
The &(F:TODAY(...)) is obsolete.

e.g.

Code: Select all

lrexec (
    function () {
        this.q_sql("?today = SELECT TODAY('yyyyMMdd')");
    },

    ....
)
Thanks