I'm having an issue trying to convert the dates of a column to be a standard MMDDYYYY format.
For example I have a table with data as follows:
ID | Date | Type |
----------------------------
1 | 20140308 | License |
2 | 20140308 | License |
3 | 48 | License |
The outcome I want to receive is:
ID | Date | Type |
-------------------------------
1 | 3-8-2014 | License |
2 | 3-8-2014 | License |
3 | 48(not sure)| License |
Is this possible when I have garbage data going into the system? I keep getting an error like this when I try to convert the dates into MMDDYYYY.
Msg 241, Level 16, State 1, Line 1 Conversion failed when converting date and/or time from character string. Warning: Null value is eliminated by an aggregate or other SET operation.
What about this....
Test Data
Query
Result Set