Type conversion error for DateFormula

liizz
Member Posts: 125
Hello all,
How to modify a field which is of DateFormula datatype?
Am getting this error 'Type conversion is not possible. DateFormula:=Text'.
Infact, I have done a SETFILTER on that field and using the MODIFYALL afterwards.
Thanks
Liizz
How to modify a field which is of DateFormula datatype?
Am getting this error 'Type conversion is not possible. DateFormula:=Text'.
Infact, I have done a SETFILTER on that field and using the MODIFYALL afterwards.
Thanks
Liizz
0
Comments
-
Can you show your code and explain the requirement please?0
-
liizz wrote:Hello all,
How to modify a field which is of DateFormula datatype?
Am getting this error 'Type conversion is not possible. DateFormula:=Text'.
Infact, I have done a SETFILTER on that field and using the MODIFYALL afterwards.
Thanks
Liizz
You will need to use the EVALUATE command, you can't directly assign text to dateformula
so
MyText := FORMAT(MyDateFormula);
Will get the DateFormula as text
and
if evaluate(MyDateFormula,MyText) then
;
Will convert text to DateFormula.
Should work.
...David Singleton0 -
Basically, you can use SETFILTER on dateformula data type.
you have to do it as david said for each record.
But if we are talking about 100's of records, the best thing will be add a text field to the table. when you assign a value to dataformula field, convert it into text and assign it to text field. so in code you can filter on this text field and modify all records.LR0 -
Ok.
I will try it out.
Liizz0 -
lakshmivalluru wrote:
But if we are talking about 100's of records, the best thing will be add a text field to the table. when you assign a value to dataformula field, convert it into text and assign it to text field. so in code you can filter on this text field and modify all records.
Can you please give me more details about how to proceed.
I just want to update a field 'Period' of datatype DateFormula from 1D to 2D.
Thanks
Liizz0 -
Simply run the table from Object designer
Place the Cursor on field which you want to modify. (in your case it is Period)
Select Edit-->Replace (it will open Period - Replace window)
Enter 1D in "Find What"
Enter 2D in "Replace With"
Click "Replace All"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