Year Functions!

Hello Guys!

I am tryimg to get table's field of year day moth but I have to write like;

for example the date is 01/01/2016 and i have to return  return  2016-quarter 1  in display method to show on form

january february mrah is quarter 1 and  april may june is quarter 2 .....

I have get the date is from table and then I have to return the date's quarter and year.

could you guys help me please?

 

  • You need to find it from the FiscalCalendarPeriod table
    have a look at, \Classes\FiscalCalendars\findQuarterByDate
  • In reply to Kranthi:

    I hope you will be knowing how to get the year from the date.
  • Hi,

    Try Like  this...

    static void SK_date(Args _args)
    {
        int month;
    
    month = mthOfYr(systemDateGet());
        info(strFmt(int2str(month)));
        if(month<=3)
        {
            info(strFmt('Quarter1-%1',year(systemDateGet())));
        }
        else if(month >= 4 && month < 7)
        {
             info(strFmt('Quarter2-%1',year(systemDateGet())));
        }
        
    }

  • In reply to Gopinath M:

    thank you so much for reply
    but I neeed to use table's date field not the systemdate i wrote the this display but it does not make sense
    display Date dispyear1()
    {
    vendtable vendtable ;

    transdate AccountingDate;

    d= vendTable.AccountingDate;

    int month;

    month =mthofyear(table.AccountingDate);
    if(month<=3)
    {
    d = strFmt("Quarter1-%1",year(vendTable.AccountingDate);
    }
    else if()
    .....
    else if()
    ...

    return d;
    }

  • In reply to Kranthi:

    usually ı am seeing year(today()); something like that.I am confusing about the getting date from the table's field actually
  • In reply to smoch9339:

    You don't have to reinvent the wheel. You already have the code in, \Classes\FiscalCalendars\findQuarterByDate.

    smoch9339
    I am confusing about the getting date from the table's field actually

    What is the issue with fetching the date from table? (table.dateField)

  • In reply to Kranthi:

    I would suggest looking at the cross references of the method, \Classes\FiscalCalendars\findQuarterByDate, to know how to use it.
  • In reply to Gopinath M:

    thank you so much!it works
Related
Recommended