Problem with first argument in CALCDATE function
poppins
Member Posts: 647
Hi everyone,
The problem I am facing is with the following instruction(my page compiles but does not run):
When I look in the Source Table of the form, "remainingTime" is of type Integer...
What shall I do???
The problem I am facing is with the following instruction(my page compiles but does not run):
MyDate := CALCDATE( "remainingTime", "Start Date");
When I look in the Source Table of the form, "remainingTime" is of type Integer...
What shall I do???
0
Answers
-
you should hit F1 and read the help about calcdate:
as you can see, integer is not a valid parameterNewDate := CALCDATE(DateExpression [, Date])
Parameters
DateExpression
Type: Text, Code, or DateFormula
[...a lot more in the help...]0 -
I know all that...
The problem is that I am reviewing an old code...and I don't have the permission to change anything in the datatypes of the table fields...I was wondering if I can convert the integer value to a date...0 -
What are you trying to do?David Singleton0
-
David Singleton wrote:What are you trying to do?
In fact, I am reviewing an old code in order to transform the forms into pages...
This is one of the issues I encountered...0 -
you've opened another thread about how to convert integer to date. Let's continue on this one.
well, if you know calcdate, you also know that it's not the function to convert integer to data
what kind of integers do you want to convert?
what date is 234567890, for example?0 -
I do know the CALCDATE() function, but maybe I didn't express myself well

I was looking for a way to convert the integer value to a date before passing it to the CALCDATE function...The integer value expresses the number of the remaining days before starting a payment...
I tried the FORMAT() function, and the errors disappeared, but I am not really sure about the results...I have to check with my manager...0 -
The correct way to achieve your goal would be defining that field as dateformula instead of integer, so that the user can type 12D, or 1M etc. Of course, your users should be trained about it.
By the way...it's an old customization with old data, so you can:
- create another field of type dateformula to store the information
- convert your integer field to date formula as follows and put the result in the new field
- clear the data the old field
- copy in a notepad the old field number
- delete the old field
- rename the new field with the number of the old one
or you can use the "dirty way":
In order to make that field a valid parameter you should format it like this.mydaysasdateformula := '<' + format(myinteger) + 'D>'
which results in <12D> (brackets to make the formula "language independent")0 -
Thank you
0 -
poppins wrote:If I have '12' in my field, it should be added to another date field (a date in which the employee got the loan)
Then tryMyDate := "Start Date"+ "remainingTime";
David Singleton0
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
- 323 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
