select 
p.pqu_certification as CERTNO,
p.pqu_certificationtype as CERTTP,
p.pqu_qualification as QUALIFICATION
FROM
r5personnelqualifications p,  r5personnel e  
WHERE e.per_user =<parameter.esignuser> AND  
e.per_code = p.pqu_person AND   
(datetime('now') BETWEEN p.pqu_qualificationstart 
AND p.pqu_expiration ) AND  ( p.pqu_tempdisqualified = '-' OR p.pqu_tempdisqualified IS NULL ) 
and ( p.pqu_certificationtype =<param.certtp>  or (p.pqu_certificationtype is not null and <param.certtp> is null))



