I am trying to extract the date from a date timestamp in excel. I currently have a data file with a mixture of date formats including date only and date timestamps. This is causing me problems as I am importing the data into SAS and it cannot read both the date only and date timestamps under the same column.
I have tried in Excel converting the timestamp to a date using the following formula:
=DATEVALUE(DAY(E32) & "/" & MONTH(E32) & "/" & YEAR(E32))
This works in excel and converts the date so that they are all formatted the same and therefore gets around the issue of the timestamp. However when I import the data into SAS, I get null values if the day is greater than 12, i.e. it is reading the date as mm/dd/yyyy. For example:
Excel Date SAS Import Date 09/12/2016 09/12/2016 15/12/2016 #VALUE!
I tried to reformat this in excel using the following to see if it would get around the issue:
=DATEVALUE(MONTH(E32) & "/" & DAY(E32) & "/" & YEAR(E32))
But I then get the same SAS error in excel.
Can anyone help suggest a formula to use in excel that will get around this issue or advice on importing the data into SAS?