Historical Dates in a report...
aaran
Member Posts: 10
I have written a report to show all Purchase Order Lines that have an 'Outstanding Quantity' greater than 0 and an 'Expected Receipt Date' of more than two days ago...
My problem is that I cannot work out the formula to set on the OnInitReport() section to set this date criterion....
Any help is greatly appreciated!!!!!
Aaran
My problem is that I cannot work out the formula to set on the OnInitReport() section to set this date criterion....
Any help is greatly appreciated!!!!!
Aaran
0
Comments
-
Perhaps this might work...
PurchLine.Setfilter("Expected Receipt Date",'..%1',Calcdate('-3D',WORKDATE));Zarryn0 -
Just use:
date - 3
and you will get the date you wanted
Example: MESSAGE(FORMAT(161178D-3));
and you'll get 13-11-78
AndréAndre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
Andre,
How would I combine your statement with todays date (rather than hard-coding a date in!)????0 -
Depending if you want the system date or the application working date use:
TODAY - 3
or
WORKDATE - 3
Example:
SETFILTER(Date Field,'..%1',TODAY - 3);
AndréAndre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
It's not working....here's how I'm using the statement....what am I doing wrong?
Report - OnInitReport()
ExpDate:=(WORKDATE-2)0 -
what is no working?Andre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
The report compiles and runs ok, but the dates on the lines returned on it are for 2nd/3rd/9th September etc. I'm expecting 31st Aug and before!0
-
well, assuming it's a simple report, you just have to put the following code
in the OnPreDataItem trigger:
Setfilter("Expected Receipt Date",'..%1',WORKDATE-2);Andre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
Yes, Keep in mind that you are writing this code in the OnPreDataItem NOT OnInitDataItem :!:0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions