select  s.SMI_objectID, sv.SMIVersion_VersionNum,s.SMITypeLocal_id, vjq.*
FROM vimis.v_SMI s
left join vimis.v_SMIVersion  sv on s.SMI_id=sv.SMI_id    
left join vimis.v_VimisTriggerSMI vts on vts.SMIVersion_id=SV.SMIVersion_id
  join vimis.VimisJournalQuery vjq on vjq.VimisTriggerSMI_id=vts.VimisTriggerSMI_id
  join vimis.VimisQueryError vqe on vqe.VimisJournalQuery_id=vjq.VimisJournalQuery_id          
where  sv.SMIVersionStatus_id=2  -- and s.VimisType_id  =3 --
and   vjq.VimisJournalQuery_insdt > '2023-01-01'
--and s.SMITypeLocal_id=14
and vjq.VimisJournalQuery_InParam like '%1.2.643.5.1.13.13.99.2.540%'
--and vjq.VimisJournalQuery_InParam like '%attribute is invalid%'
 --and s.SMI_objectID=180101016349188
