--vesp_getformatfields 'ATTACHNUM1'

--select formatid, count(*) cnt from vefn_getversionformatitems('') where formatid in (39, 38, 41, 136) group by formatid

select vn.foldername, dbo.ve_getshortpathfromcontentid(cc.contentid)
from vefn_getversionformatitems('') vi
join vefn_getversionnames() vn on vi.versionid = vn.versionid
join contents cc on cc.contentid = vi.contentid
where (vi.formatid = 41 and cc.type = 10004) or (vi.formatid = 136 and cc.type = 10005)