[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: Fri May 19, 2017 1:34 am

[RPG/JS] Example of TODAY function

Post by mwilliams » Tue Jun 13, 2017 1: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: Wed Apr 18, 2012 10:21 am

Re: [RPG/JS] Example of TODAY function

Post by tsupartono » Tue Jun 20, 2017 12: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: 122
Joined: Wed Jan 11, 2017 3:26 pm

Re: [RPG/JS] Example of TODAY function

Post by jasonzhou » Fri Jun 30, 2017 11:35 am

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