I have a posting date filtering set by user.
If user set 01-08-07..3108-07, mine Cust. Ledger Entry.GetFilter("Posting Date") would retrieve value of 08-07 or Aug 07.
Eg: FilterText := Cust. Ledger Entry.GetFilter("Posting Date");
If Evaluate (FilterDate,FilterText) Then; //convert filter text to date format
Now I would like to FilterDate1 := CalcDate('-1Y', FilterDate) ?
It gave me an error:
You cannot base a date calculation on an undefined date.
Date : 0D
Formula: -1Y
0
Comments
If Evaluate (FilterDate,FilterText) Then
FilterDate1 := CalcDate('-1Y', FilterDate)
if input for filter text = 08-07 ?
(Aug 07)
Does the calcdate works?
What exactly you want to achieve?
I wanted to put a date range (01-08-07..31-08-07), but I realized while I was testing the output was
08-07 instead. Not sure if I had key in wrongly.
Consider that user might be keying it wrongly too.
JDI
If user simply enters 08-07 then system will consider as the 08-07-(Current year) i.e 08th day of July .
It does not mean that Aug'07
If you want to get the Minimum date and Maximum date entered in the Date filter then use the
GetRangeMin and GetrangeMAx functions.
Thanks, will do.
In that case if I need to offset user input date by 1 year I would do as follows:
StartDate := GetRangeMin(DateFilter); EndDate := GetRangeMax(DateFilter);
StartDate1 := CalcDate..