Dataport to import date, but wrong format.
 
            
                
                    kikkoman                
                
                    Member Posts: 57                
            
                        
            
                    I am working on a dataport where I am importing some fields, of course.  well, there is a field that I need to import, which so happens to be a date field. The date field in Navision is set to be US, so its MM/DD/YY.  The field that I am importing is in format DD/MM/YY.
Ex. 23/1/2005 (this will not work b/c 23 is not a month, only 1-12, but if I change it to 1/23/05, and my dataport works b/c its in the format that I can use)
I have tried looking up format(), but doesn't seem to work with this scenario, I think. :-k b/c I will never be able to as date := text field
So what I did was hard coded it, where the import is assigned a text field, and the I break the text field correctly and switch the numbers around and get it into the format that I need, which is MM/DD/YY. Now the problem is that I can't assign this new text to the date field in the job journal line b/c of mismatched types.
"Job Journal Line"."Posting Date" := newtext; //newtext = 1/23/05
so my question is, what is the best way to do this? it seems like there could be a function that could do this without me having to hard code it, ......but i don't mind...i enjoy it!!!....but if someone could help me on this ...it would be GREAT!!!! i need a way to convert the incoming date to my format!
THANKS,
                Ex. 23/1/2005 (this will not work b/c 23 is not a month, only 1-12, but if I change it to 1/23/05, and my dataport works b/c its in the format that I can use)
I have tried looking up format(), but doesn't seem to work with this scenario, I think. :-k b/c I will never be able to as date := text field
So what I did was hard coded it, where the import is assigned a text field, and the I break the text field correctly and switch the numbers around and get it into the format that I need, which is MM/DD/YY. Now the problem is that I can't assign this new text to the date field in the job journal line b/c of mismatched types.
"Job Journal Line"."Posting Date" := newtext; //newtext = 1/23/05
so my question is, what is the best way to do this? it seems like there could be a function that could do this without me having to hard code it, ......but i don't mind...i enjoy it!!!....but if someone could help me on this ...it would be GREAT!!!! i need a way to convert the incoming date to my format!
THANKS,
0                
            Comments
- 
            I think you are looking for the EVALUATE(variable, text) command.
 Check the help for all the syntax and comments.
 This command casts text into the datatype of the variable. Has a return value to say whether or not the conversion was successful.This isn't a signature, I type this at the bottom of every message0
- 
            thanks Steve0....that was what I needed....I would've never figured that out for along while!!!!....you da man!!! \:D/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
