Hi all,
I Have a question regarding a formula,
Local DateVar d1 := (CurrentDate);
Local DateVar d2;
d2 := DateSerial(Year(d1), Month(d1) + 1, 1 - 1);
d2 - (DayOfWeek(d2, crFriday) - 1)
The above mentioned formula gives me exactly what I need, i.e. date of last friday of the month.
But, Below mentioned formula is same as the above, except the declaration of variables, but this formula gives me different result.
DateSerial(Year(CurrentDate), Month(CurrentDate) + 1, 1 - 1) -(DayOfWeek(CurrentDate, crFriday) - 1)
Please suggest me whats wrong here.
Thanks in advance.
I Have a question regarding a formula,
Local DateVar d1 := (CurrentDate);
Local DateVar d2;
d2 := DateSerial(Year(d1), Month(d1) + 1, 1 - 1);
d2 - (DayOfWeek(d2, crFriday) - 1)
The above mentioned formula gives me exactly what I need, i.e. date of last friday of the month.
But, Below mentioned formula is same as the above, except the declaration of variables, but this formula gives me different result.
DateSerial(Year(CurrentDate), Month(CurrentDate) + 1, 1 - 1) -(DayOfWeek(CurrentDate, crFriday) - 1)
Please suggest me whats wrong here.
Thanks in advance.