[RPG/JS] Example of TODAY function

Please do not use to report errors- use your regional help desk.
Please mark posts as being for RPG or RDMLX (LANSA) developer.
To subscribe by email, display this forum, scroll to the end and select ‘Subscribe Forum’.
Post Reply
mwilliams
Posts: 17
Joined: Thu May 18, 2017 10:34 am

[RPG/JS] Example of TODAY function

Post by mwilliams » Mon Jun 12, 2017 10:08 pm

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
);

tsupartono
Posts: 289
Joined: Tue Apr 17, 2012 7:21 pm

Re: [RPG/JS] Example of TODAY function

Post by tsupartono » Mon Jun 19, 2017 9:32 pm

Apology for the late response.
This sounds like a bug to me, can you please log a bug report with LANSA Support? Thanks.

jasonzhou
Posts: 116
Joined: Tue Jan 10, 2017 11:26 pm

Re: [RPG/JS] Example of TODAY function

Post by jasonzhou » Thu Jun 29, 2017 8:35 pm

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

Post Reply