Business Day

Hello AXmates,

Imust to calculate some dates, there’s no problem, but with this calculated date How I can know if it is a business day or a weekend day ??

Regards and thanks.

Do you mean business day as in week days? If yes, then the following snippet might help -

static void dayOfMthExample(Args _arg)
{
date d = today();
int i, j;
;
i = dayOfMth(d);
j = dayOfWk(d);

print "Today’s day of the month is " + int2Str(i);
print "Today’s day of the week is " + int2Str(j);
print "Today’s is " + dayName(j);
print "This month is " + (mthName(mthofyr(d)));

pause;
}

Hi Spulit,

Try this…

static void day_Type(Args _args)
{
TransDate d = mkdate(26,06,2011);
str day;
str type;

void typeOfDay()
{
switch(day)
{
case ‘Monday’ :
type = ‘Bussiness Day’;
break;

case ‘Tuesday’ :
type = ‘Bussiness Day’;
break;

case ‘Wednesday’ :
type = ‘Bussiness Day’;
break;

case ‘Thursday’ :
type = ‘Bussiness Day’;
break;

case ‘Friday’ :
type = ‘Bussiness Day’;
break;

case ‘Saturday’ :
type = ‘Weekend Day’;
break;

case ‘Sunday’ :
type = ‘Weekend Day’;
break;
}
}

day = dayname(dayofwk(d));
typeOfDay();

print type;
pause;
}

Naresh Kolli

What do you mean by business day?

Hello,

Thanks for your answers it are very useful.

When I says business day Is a day it’s not necessary go to work, including feast days. Is there some calendar with that information ?

Thanks and regards.

No.You have to define a calendar in the system…

After some days I try your answers and it’s working correctly but receiving more information about the development I must to define a calendar, I don’t know how but I think this is another battle.

Regards and thanks !!!