. set obs 1
. gen var=20190417 // today's date in a custom format
. format var %10.0g // so the full number can be seen in the editor
. list
+----------+
| var |
|----------|
1. | 20190416 |
+----------+
I have fallen into this trap many times until I realised that Stata thinks 20190417 equals to 20190416 ...

These days I use gen long but still, this should not happen.
Any thoughts?
0 Response to Storage type of a new variable
Post a Comment