Date Filter options
Washout
Member Posts: 24
Hi,
I am writing a report and setting a Date Filter.
however in my code I have
SETFILTER("Order Date",'%1..%2',StartDate,EndDate);
This works for the following
05/05/08
05/05/08..30/06/08
Is it possible to write the code so that I can also use it for the following
<05/05/08
>05/05/08
Also
If :I have an option field on a table and I want to setrange on 2 specific options. how is it done?
hoping you can help
I am writing a report and setting a Date Filter.
however in my code I have
SETFILTER("Order Date",'%1..%2',StartDate,EndDate);
This works for the following
05/05/08
05/05/08..30/06/08
Is it possible to write the code so that I can also use it for the following
<05/05/08
>05/05/08
Also
If :I have an option field on a table and I want to setrange on 2 specific options. how is it done?
hoping you can help
0
Comments
-
for All dates (before stratDate OR after Enddate)
SETFILTER("Order Date",'<%1|>%2',StartDate,EndDate);
for (all dates Not equal to StartDate)
SETFILTER("Order Date",'<>%1',StartDate);Sandeep Prajapati
Technical Consultant, MS Dynamics NAV0 -
Sandeep Prajapati wrote:for All dates (before stratDate OR after Enddate)
SETFILTER("Order Date",'<%1|>%2',StartDate,EndDate);
for (all dates Not equal to StartDate)
SETFILTER("Order Date",'<>%1',StartDate);
but when the user runs the report.
how can we check which option the user entered into the date filter?
example if user types >310608
how does the code know that thats what he typed?0 -
It can be done without writing a single line code.... :idea:how does the code know that thats what he typed?
filters can be applied on fields by setting field(s)'s name in [ReqFilterFields] property of the dataItem of report.
there user can input all combination of date filters. how to input the date filter..?? Please see help.
Sandeep Prajapati
Technical Consultant, MS Dynamics NAV0 -
Hi WashoutWashout wrote:how does the code know that thats what he typed?
You can get (and then print) what is filtered by using the GETFILTER function which returns a string of the filter. To set a filter you can do as Sandeep suggests
Hope this helps0 -
Run report 3, and look at the last filtering option. It is a flowfilter called Date Filter. There the user can enter whatever they want, and you can use
correctfitlerstring := GETFILTER("Date Filter");
If you have added a field to the options tab that is a date filter, consider instead adding a flowfilter to your table, called Date Filter, and then using the above code to properly filter by date. It is a lot easier because Navision does the work for you.
-a0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 322 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