Code: Select all
for !y = 2001 to 2015 'forecast over all available years
if !y=2015 then !mm=@datepart(@now,"mm") else !mm = 12 'Only forecast from a starting point in the present
endif
for !m = 1 to !mm 'loop through the months of the year
'For each month we produce a remainder of the month forecast and 3 months out
%from = @datestr(@makedate(!y, !m, 15, "yyyy mm dd"),"mm/dd/yyyy")
%to = @datestr(@makedate(!y, !m+3, "yyyy mm"),"mm/dd/yyyy")
smpl %from %to
Code: Select all
smpl @makedate(!y, !m, 15, "yyyy mm dd") @makedate(!y, !m+3, "yyyy mm")As a simpler example, this also doesn't work:
Code: Select all
smpl 2003 @makedate(2004,"yyyy")Code: Select all
smpl 2003 2004