Date functions

sunct
Member Posts: 72
Hello,
I am having a requirement... if you enter any date in the system, the last date of that month should be populated automatically..
any one can help?
Thxs and regds
I am having a requirement... if you enter any date in the system, the last date of that month should be populated automatically..
any one can help?
Thxs and regds
Regards,
Sunil
Sunil
0
Comments
-
take a look to the systemfunction: (System -> Date -> Calcdate
NewDate := CALCDATE(DateExpression [, Date])
This function (and an help for this) you can find when using C/AL Symbol Menu (F5 in designmode) and press then F1
RegardsDo you make it right, it works too!0 -
I do it by this function
LastMonthDayOfDate(pDate : Date) : Date
DateRec.SETRANGE(DateRec."Period Type",DateRec."Period Type"::Month);
DateRec.SETRANGE(DateRec."Period Start",DMY2DATE(1,
DATE2DMY(pDate,2),
DATE2DMY(pDate,3)));
DateRec.FIND('-');
EXIT(NORMALDATE(DateRec."Period End"));0 -
Thanx a lot ... It helped me!
RegdsRegards,
Sunil0 -
use Calcdate. You need no new function :!:
EndDateMonth := calcdate('<CM>',today)Do you make it right, it works too!0 -
So jujst to elaborate a little:
- "CM" gets you the last day of the month of the date that you passed into CALCDATE.
- "-CM" gets you the first day of the month of the date that you pass into CALCDATE
- the "<" and ">" around the dateformula is to make the system language independent
0 -
Hi,
Good to know. I use calcdate only to plus or minus some period to date. Good to read help sometimes. ](*,)
Regards.0 -
jupp, sometimes, the "Help" will help :whistle:Do you make it right, it works too!0
-
Also, the first stop for syntax should be the C/SIDE reference guide, from the help menu. It has an excellent search function.0
-
thats right. Every person, who is new (or old) on NAV, should be use the help (F1) after this, search the forum, there are many questions and answers, or tell us your question. But first: Use help and your brain. [-o<
These are no angry words 8)
So, good nightDo you make it right, it works too!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