Very simple, may have been answered in another post, I just wanted to get the question out before looking. I need to get my the year from my date variable. For example, with 01-01-1999, I need 1999, then destring it so I can get a number. However, I encounter an issue. Sometimes, when I run -gen year = substr(data_var, -4, 4)- , no matter what date variable, sometimes one of the numbers... its like you hit shift on the keyboard when typing it out, meaning 1994 becomes 199$, or 1991 becomes 199!, and I am not sure why. When I go back to the original date variable, sure enough the date is all numbers, so 199$ was originally 1994 in the original variable, I am not sure why this is doing this.
Load.... lets say 10mil random dates, I am sure when you substring them to get the year some of them (not a lot, maybe 5 max) will be in the weird format I mentioned.
Load.... lets say 10mil random dates, I am sure when you substring them to get the year some of them (not a lot, maybe 5 max) will be in the weird format I mentioned.
Comment