DateFormula fields

blikens
Member Posts: 10
I'm trying to populate some new fields in a table with processing only report. One of the fields was set up as DateFormula type. When I try to compile my report with a line such as
Customer."InState Ship Lead" := -5D ;
I get an error message that there is something wrong with my constant. I can manual enter -5D into the table without a problem. Any suggestions?
Customer."InState Ship Lead" := -5D ;
I get an error message that there is something wrong with my constant. I can manual enter -5D into the table without a problem. Any suggestions?
0
Comments
-
The data for the dateformula should be entered as text, so surround it with single quotes and it should do what you want.
John0 -
I've tried the single quote. I get a different error referencing type conversion. If I create a test report of the processing only type, and put the following line of code in the OnPreDataItem() trigger:
Instate := -5D ; (where Instate is a global variable
of the dateformula type
I get an error stating there is something wrong with my constant.
If I enclose the -5D in single quotes, I get an error referencing type conversion.0 -
Yes you are right it does not work how you would expect it to.
The best way to set the value of a dateformular is with the Evaluate function.
i.e.
EVALUATE(da,'-5d');
Paul Baxter0 -
Thank you kindly for your assistance. The EVALUATE command suggestion worked perfectly and will help me resolve issues with several other objects I'm working on. THANKS!!!0
-
Do remember that the SQL-option does not support DateFormula as datatype. Instead change the field to Code (i.e. length 20) and set the property DateFormula to Yes.0
-
Thanks for the extra help. It should come in handy as we are in the process of trying to decide how to make some of our Navision database accessible to our customers. One of my coworkers wants to open up our firewall and let customers access an onsite webserver, but I have my reservations. I guess I should pursue this in another topic, though. Thanks again.
Bill0
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