Hi,
I have a requirement to import data from text files of fixed length to table. When I try to import the text (for date) field to date field in the table, I am unable to do it.
My requirement is how to convert the text field to date field and store in the table? I have searched in the forum, but I could not able to fine the solution.
Can anyone help me in achieving this?
Thanks,
Aravindh.
0
Comments
02011062201400200000001 - are the data in text file.
Fieldwise
Field 1 - 0
Field 2 -20110622: This is the format of the date field in text format (yyyymmdd)
Field 3 - 01
Field 4 - 4002
Field 5 - 00000001
Thanks,
Aravindh.
Tried in different possibilities. Can you still more clear, how to approach?
Thanks,
Aravindh.
Global Variables
ImportString->Text->250
isDay->Integer
isMonth->Integer
isYear->Integer
View->Dataport Fields->SourceExp-> (type in) ImportString
If the key fields need validation it would be like:://ie.
VALIDATE("YourTable".Field1, COPYSTR(ImportString,1,1));
The 4 fields other than the date field are type TEXT.
If the field you are importing to are not type text //ie Integers or something use EVALUATE.
Save->Compile->Enjoy
http://www.BiloBeauty.com
http://www.autismspeaks.org
Aravindh.