Get first day of year

tandzy
Member Posts: 3
Hello everyone, I am new here so sorry if my question sounds a little bit stupid
But cant find anywhere this what I need.
So, I want my user to enter year on Request Page like just 2015.
Then I must in my code somehow get the first day of that year and the last day of that year.
It would be like this - user enter 2015 and I want to get 01.01.2015 and 31.12.2015.
Thanks in advance for your replies,
](*,)

So, I want my user to enter year on Request Page like just 2015.
Then I must in my code somehow get the first day of that year and the last day of that year.
It would be like this - user enter 2015 and I want to get 01.01.2015 and 31.12.2015.
Thanks in advance for your replies,
](*,)
0
Comments
-
Check out the function DMY2DATE.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Kriki, thank you for your reply.
I know what function DMY2DATE is used for ( at least I think I know). I use it when I want to get day, month or year from specific date like
Day := DATE2DMY(SomeDate,1);
Month := DATE2DMY(SomeDate,2);
Year := DATE2DMY(SomeDate,3);
But I think I need the oposite of that - I say year and for output I need date of first day in that year like I said in previous post
From 2015 i want to get 01.01.2015
and 31.12.2015.
Thank youuuu very much.
:shock: :shock: :shock:0 -
The DMY2DATE is the opposite function of DATE2DMY. So it is the function you need.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
... or use the CALCDATE function, based on your date:
FirstDayOfYear := CALCDATE( '<-CY>', YourDate ); LastDayOfYear := CALCDATE( '<CY>', YourDate );
Jan Veenendaal1 -
Jan Veenendaal wrote:... or use the CALCDATE function, based on your date:
FirstDayOfYear := CALCDATE( '<-CY>', YourDate ); LastDayOfYear := CALCDATE( '<CY>', YourDate );
If you only have an integer for the year, then DMY2DATE is what you're looking for0
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