my source sequencial file has three attributes.
one dd-mm-yyyy format
two:mmddyyyy format
three: yyyy/dd/mm format
I wants convert string to date format the above all attributs.
How to validate and convert from string to date.
Pls help me.
String to Date
Moderators: chulett, rschirm, roy
![Exclamation :!:](./images/smilies/icon_exclaim.gif)
I've made assumptions about your environment (8.x,PX,UNIX), if any are incorrect please edit your post and change them appropriately. Thanks.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Now on to your question...
First tell us if you have these formats in different fields, meaning you know what format will be coming where, or if they are all mixed into a single source field. The former is pretty straight-forward while the latter will require you to identify the proper format to use in a series of if-then-else constructs... as one example of an approach.
Regardless, the solution is the same - the use of the StringToDate() function with a mask that matches the incoming date format so it knows how to convert it.
First tell us if you have these formats in different fields, meaning you know what format will be coming where, or if they are all mixed into a single source field. The former is pretty straight-forward while the latter will require you to identify the proper format to use in a series of if-then-else constructs... as one example of an approach.
Regardless, the solution is the same - the use of the StringToDate() function with a mask that matches the incoming date format so it knows how to convert it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers