Dateformula
dabba23
Member Posts: 77
I have a dateformula: 4M. Is it possible to turn it into an integer?
Thanks
Ann
Thanks
Ann
0
Comments
-
Do you mean an integer telling how many days or how many months?0
-
I want to know the number of months!!!0
-
1. You can do a format on the field and remove the 'M'
2. Or calculate 4M from 1st of january, put a filter on the date table with filter on months and count the records.
1st option is the easiest but won't work with all languages, 2nd option is more work but better I think.0 -
I have tried the format, maybe you can tell me where im going wrong on the syntax:
IntLength := Format(PeriodLength,-'M');
Error message: Integer := Text
IntLength, datatype Integer
PeriodLength, datatype Dateformula
Makes no difference leaving -M outside brackets0 -
FORMAT returns a text value, and you can't set an integer value directly to a text value. You will need to do EVALUATE(MyInt,MyText).
As far as using FORMAT to get rid of the M, I'd like to see how that works too
. Come on Mark, it's been at least more than 6 minutes! What's keeping you so long? :-k 0 -
Try this:
txt := FORMAT(MyDateFormula); txt := DELCHR(txt,'=',DELCHR(txt,'=','1234567890')); EVALUATE(int,txt);
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
DenSter wrote:Come on Mark, it's been at least more than 6 minutes! What's keeping you so long? :-k
Gone home, picked up my daughter at my in-laws, eating, stuff like that
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
- 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

