{exp:query sql="SELECT count(*) as the_count FROM exp_channel_titles WHERE entry_id={stash:guidelink_uid} AND channel_id=111 AND status!='closed' "} {if '{the_count}'>'0'}Found{if:else}Missing{/if} {/exp:query}