Convert Text To Date Filter

ricky76
Member Posts: 204
I wondered if anyone could help me, i have a date filter on a report that i pass over to another report as text. With this i then want to automatically set the date filter on the second report. When i have it as text is there a quick way that i can convert this to a date filter so that i can select the max date from the filter?
0
Comments
-
You can use:
mytable.setfilter(mydatefield,dateAStext)
if you have 12/03/07..31/12/07 in your date filter, you will filter your date field from 12/03/07 to 31/12/07
...or do you want to achieve something else? :-k0 -
See this Example..... Does this help you
Name DataType Subtype ILE Record Item Ledger Entry DateFilterStrin Text Qty Integer GLE Record G/L Entry //.................................................................................................. GLE.reset; GLE.SETFILTER(GLE."Document Date",'%1..%2',010101D,010108D); // putting Filter on G/L Entry Rec if GLE.FINDSET then DateFilterString := GLE.GETFILTER("Document Date"); MESSAGE('DateFilterString : %1',GLE.GETFILTER("Document Date")); Qty := 0; ILE.RESET; ILE.SETFILTER(ILE."Document Date",GLE.GETFILTER(GLE."Document Date")); // Passing that Filter to ILE IF ILE.FINDSET THEN REPEAT Qty := Qty + ILE.Quantity; UNTIL ILE.NEXT= 0; MESSAGE('On Using GetFilter ....%1',Qty); Qty := 0; ILE.RESET; ILE.SETFILTER(ILE."Document Date",DateFilterString); // Passing the Datefilter String IF ILE.FINDSET THEN REPEAT Qty := Qty + ILE.Quantity; UNTIL ILE.NEXT= 0; MESSAGE('On Passing DateFilterString...%1',Qty);
Sandeep Prajapati
Technical Consultant, MS Dynamics NAV0 -
Hi,
I have a variable of type text DateFilterStr, and if I put 't' or 'w' ('t'- for TODAY, and 'w' for Work Date) and use this function
"Salesperson/Purchaser".SETFILTER("Salesperson/Purchaser"."Date Filter",DateFilterStr);
DateFilterStr:= "Salesperson/Purchaser".GETFILTER("Salesperson/Purchaser"."Date Filter");
it doesn't displays the Today -t or Work Date -w, but it displays strange dates.
Let's say that Today=15/11/2012, and Work Date =15/11/2012 , when i put in this field 't' it returns date 13/11/2012, when i put 'w' it returns date 14/11/2012. If i change the Work date to '01/01/2012', and pres 't' or 'w' it returns dates 27/12/2011 for 't' and 28/11/2011 for 'w'.
DateFormat (dd/MM/yyyy)
Any suggestions why?
Thanks,0 -
Thanks Belias,
That's it. I have tested it to diferent dates, and it returns t=tuesday and w=wednesday within that week of Work Date.
You can use all letter of day, or just the first letter. Also if you put 'Sunday' it returns date of that Sunday.
strange!!! isn't?0
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
- 320 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