Number of day in a month

SYLV1GSYLV1G Member Posts: 93
Hello

I would like to know how i can obtain the number of days in the month for a defined date.

for example 02.2011 = 28

Thanks in advance for your help.

SG

Comments

  • vijay_gvijay_g Member Posts: 884
    Try it....
    RecDate.RESET;
    RecDate.SETRANGE("Period Type",RecDate."Period Type"::Date);
    RecDate.SETRANGE("Period Start",MonthStartDate,MonthEndDate);
    NoofDays :=  RecDate.count;
    or
    StartDate:= DMY2DATE(01,Month,Year);
    EndDate := CALCDATE('CM',StartDate);
    NoofDays :=  (EndDate - StartDate)+1;
    
  • SYLV1GSYLV1G Member Posts: 93
    Thank you for your help.

    SG

    :D
Sign In or Register to comment.