The first day of a month
static void FirstOfMonth(Args _args)
{
TransDate TransDate=today();
TransDate FirstOfMth;
;
FirstOfMth=mkdate(1,mthofyr(TransDate),year(TransDate));
info(date2str(FirstOfMth,123,2,2,2,2,4));
}
--------------Or--------------------------
static void FirstOfMonth(Args _args)
{
TransDate TransDate=today();
TransDate FirstOfMth;
;
FirstOfMth=DateStartMth(TransDate);
info(date2str(FirstOfMth,123,2,2,2,2,4));
}
The first day of a month
static void LastOfMonth(Args _args)
{
TransDate TransDate=today();
TransDate LastOfMth;
;
LastOfMth=endmth(TransDate);
info(date2str(LastOfMth,123,2,2,2,2,4));
}
--------------Or--------------------------
static void LastDateofMonth(Args _args)
{
yr y = 2012;
int m = 02;
TransDate endDate;
int NoOfDays;
;
endDate = Global::dateEndMth(mkdate(01,m,y));
NoOfDays = dayOfMth(endDate);
info(strfmt("%1",NoOfDays));
}
No comments:
Post a Comment