#MONTH function not working? - Forum - Rollbase - Progress Community

#MONTH function not working?

 Forum

#MONTH function not working?

This question is answered

Hi,

It says 'invalid character' when I use "#MONTH(date)" function to get the number of the given date..?
What could be the issue..?

Thanks in advance,
Ithrees

Verified Answer
  • Hi,
     
    #MONTH token is supposed to be used in following cases

    ·         When Creating View with Filtering based on expression. We can use #MONTH token in formula fitered field. Please see chapter 3 in Rollbase in Action for details.

    ·         In Query API, Select Query Where clause. Ex : rbv_api.selectQuery("SELECT {!id} FROM test111 where {!#OBJ_ID.test111} <= #MONTH('21-07-2014')",20) . Please see chapter 6 in Rollbase in Action for details

     
    Thanks
    Pradeep
     
    From: ithrees.ai [mailto:bounce-ithreesai@community.progress.com]
    Sent: Monday, April 28, 2014 4:42 PM
    To: TU.Rollbase@community.progress.com
    Subject: #MONTH function not working?
     
    Thread created by ithrees.ai

    Hi,

    It says 'invalid character' when I use "#MONTH(date)" function to get the number of the given date..?
    What could be the issue..?

    Thanks in advance,
    Ithrees

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

All Replies
  • Hi,
     
    #MONTH token is supposed to be used in following cases

    ·         When Creating View with Filtering based on expression. We can use #MONTH token in formula fitered field. Please see chapter 3 in Rollbase in Action for details.

    ·         In Query API, Select Query Where clause. Ex : rbv_api.selectQuery("SELECT {!id} FROM test111 where {!#OBJ_ID.test111} <= #MONTH('21-07-2014')",20) . Please see chapter 6 in Rollbase in Action for details

     
    Thanks
    Pradeep
     
    From: ithrees.ai [mailto:bounce-ithreesai@community.progress.com]
    Sent: Monday, April 28, 2014 4:42 PM
    To: TU.Rollbase@community.progress.com
    Subject: #MONTH function not working?
     
    Thread created by ithrees.ai

    Hi,

    It says 'invalid character' when I use "#MONTH(date)" function to get the number of the given date..?
    What could be the issue..?

    Thanks in advance,
    Ithrees

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

  • Thank you for your reply Pradeep.

    Is there any specific rollbase function to get the month number.. or we have to use javascript date function..?

    Thanks and Regards,

    Ithrees

  • Hi,

    You can make use of the mentioned functions in the documentation based on your requirement. Find the below link with the examples.

    documentation.progress.com/.../index.html

    Thanks & Regards,

    Kiran Avs.

  • Thank you Kiran,

    But I dont see any of these api is returning a number (1-12) from a date like getMonth() in javascript..

    Thanks and Regards,

    Ithrees

  • Hi ,

    I am Not sure if we have an APi which will give you month (number value) directly unlike in javascript . However , you can use rbv_api.formatDate() api and retrieve  month ( in number ) , as shown in below example .

    var d= rbv_api.selectValue("select updatedAt from obj124 where id=?", {!id});

    var x = rbv_api.formatDate(d, "MM");

    rbv_api.println("x="+x);

    output :- 04

    Hope you find this useful .

    Thanks,

    Sharavan

  • Thank you Sharavan,

    Its a good one..



  • Sent from my iPhone

    On 28-Apr-2014, at 20:42, "ithrees.ai" <bounce-ithreesai@community.progress.com> wrote:

    Reply by ithrees.ai

    Thank you Sharavan,

    Its a good one..

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.