Hi all!
So... I need to filter information in table by year.. For example: there is a field in table Posting date and i need to filter it only by year>>
14/12/07 that's the value of it, and i wanna filter it by 2007..
If any ideas, just help..
Thanks to all
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
for example: information in table:
Posting date:
01/01/07
05/09/07
25/06/08
and i wanna filter it only by year, for example i need to filter it by 2007.. you see?
Attain Navision
When you use "01/01/07..31/12/07" this will filter the year for you..
Or explain the problem a bit more.
Tino Ruijs
Microsoft Dynamics NAV specialist
okay.. i have table A, and there's field named as year(text type:2006,2007,2008 and s.o.).. And i need to take the meaning of that year field and set filter on the table B.. But the case is, i can set the filter on the B table's field "Posting Date", i have a problem, "Posting Date" is a date type field, and i wanna set the filter on it by A table's field year... So if any ideas, just go ahead..
Attain Navision
You can use functions that you can find in the C/AL Symbol Menu.
SYSTEM, DATE, DMY2DATE.
SETRANGE(date, DMY2DATE(1, 1, year), DMY2DATE(31, 12, year);
Tino Ruijs
Microsoft Dynamics NAV specialist
By the way. To use the function DMY2DATE, year needs to be an integer.
So it's better to define year as integer.
When that's not possible anymore use EVALUATE(intYear, txtYear); to turn your text into integer.
Tino Ruijs
Microsoft Dynamics NAV specialist
Try to think about it. What is Year? Year is everything between 1st of January and 31st of December, isn't it? If yes, filtering for year 2007 means filtering everything with date 1/1/07 to 31/12/07. And it is what I wrote. Forgot about "text filtering". If the date is saved as text, you can filter like "*/07". If it is date, you need to filter the whole year period by "1/1/07..31/12/07". If you do not know how to calc the limit dates, you can use
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
......
DMY2DATE(1,1,MyYear)..DMY2DATE(31,12,MyYear);
That's part of my code... It's really works..
Attain Navision