endt:=20190101T;
dEndt:=datetoint(endt);//日期转整型-天软基本面中日期都存为整型
t:= select thisrow as '证券代码',
spec(base(302003),thisrow) as '设立日',
GetFundLastEndDate(thisrow) as '清算日' ,//基金清算日
spec(base(302013),thisrow) as '投资类型'
from getbk('普通股票型;已退市基金')
end;
//筛选指定日在运作的
return select * from t where ['投资类型']='普通股票型'
and (['设立日']>0 and ['设立日']<=dEndt and (['清算日']>dEndt or ['清算日']=0))
end;