Problem with CALCDATE in a report
DarkHorse
Member Posts: 389
Hello, I want to do in a report an easy calc. I've "Posting Date" field from "Purch. Rcpt. Header" and "Confirmation Date" field from "Purch. Rcpt. Line" table. I want to calc the days between a date and the other. I put:
IF ("Purch. Rcpt. Header"."Posting Date"<>0D)
AND ("Confirmation Date"<>0D)THEN
BEGIN
calc2:=CALCDATE("Confirmation Date","Purch. Rcpt. Header"."Posting Date");
END;
calc2 is a Date variable.
It runs well but, in several cases, it appers an error on run the report that says:
"The Content .... from CALCDATE parameter number 1 is invalid"
In dots appears a date, depends of the filter. I suppose that intent to do the operation but there are assumtions that can't calculate. I've try to put several conditions like "if this case is <>0D show 0" and thinks like that, but always appers the same error. Does anybody knows what can be the problem?.
Thanks in advance.
IF ("Purch. Rcpt. Header"."Posting Date"<>0D)
AND ("Confirmation Date"<>0D)THEN
BEGIN
calc2:=CALCDATE("Confirmation Date","Purch. Rcpt. Header"."Posting Date");
END;
calc2 is a Date variable.
It runs well but, in several cases, it appers an error on run the report that says:
"The Content .... from CALCDATE parameter number 1 is invalid"
In dots appears a date, depends of the filter. I suppose that intent to do the operation but there are assumtions that can't calculate. I've try to put several conditions like "if this case is <>0D show 0" and thinks like that, but always appers the same error. Does anybody knows what can be the problem?.
Thanks in advance.
0
Comments
-
To get the number of days between two dates you can subtract them:
Result := "Confirmation Date" - "Purch. Rcpt. Header"."Posting Date";
Regards,
ReijerReijer Molenaar
Object Manager0 -
:oops: I've trying with CALCDATE; well thanks for your help. Another question, sometimes the result is negative; is there any way that shows always in postive?.
Thanks for your help.0 -
Yes, that is possible with ABS.
ABS("Confirmation Date" - "Purch. Rcpt. Header"."Posting Date");Reijer Molenaar
Object Manager0 -
Fantastic!!! =D> , Thank you very much for your help and time.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
