Is it possible to get a loop that works with every string variable which are in date format (CCYY-NN-DD but string) to destring them?
For example :
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str10 Da byte Bod str10 Pre
"2020-04-17" 12 "2020-04-17"
"2020-05-22" 10 "2020-05-22"
"2020-09-17" 23 "2020-09-17"
"2020-04-21" 24 "2020-04-21"
end
I would like to get my 2 dates variables in this format : %tdDD-NN-CCYY (but i need a loop because i've tons of date variables in my database)
Thanks you !
0 Response to Working with dates and loop
Post a Comment