I have a tiny sample here in which I am ultimately trying to extract the YEAR, MONTH, DAY out of a comma-delimited source. The source has the following three fields:
The PurchaseDate field in each record starts with a + sign and looks like; +19950610
I can remove the + sign with the following script but cannot get any further in rendering the field as a Date and then in the attempt to extract the Year, Month and Day as mentioned. There is so much information in the Community on how to do it but I have had no success with any. Though my sample is tiny, it represents an issue with a much larger file in the hundreds of thousands of records. Any help in constructing the corrrect script would be most appreciated.
SET TimeFormat='h:mm:ss TT';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
//strip out the leading + sign fromn the PurchaseDateField
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Re: Format a text field to a YYYY/MM/DD date field
You can close discussions by giving Correct (max to one answer) and Helpful (if I'm not wrong max to 2 answers) answers to the posts which are useful for you. It helps others in finding answers for similar scenarios.