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,
0
Comments
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.