I am trying to save a date range as a macro. I have it working to a degree with:
Code:
su date local min = `r(min)' local max = `r(max)' global ran= "`min'_`max'" gen Dates_$ran=.
I have ready all the other posts I found on the topic, this one being preeminent https://www.statalist.org/forums/for...dnnccyy-format.
I can create a macro with today's date using the below code but cannot do the same for a date of interest in the past.
Code:
local wanted : di %tdDNCY daily("$S_DATE", "DMY") di "`wanted'"
Can anyone tell me how to make a macro with a past date in understandable format?
Thanks.
0 Response to Creating local (or global) macro of past date (or range), in DDNNCCYY format
Post a Comment