select      crw_code,crw_desc,crw_org FROM r5crews,r5crewemployees
WHERE COALESCE(crw_notused,'-') = '-'
AND crw_code = cre_crew
AND crw_org = cre_crew_org
AND cre_person =  <parameter.employee>
AND date(<parameter.bookdate>) BETWEEN date(cre_start) AND date(cre_end) AND
DATE(IFNULL(CRW_EXPIRATIONDATE,DATE('now'))) >= DATE('now')
order by crw_code ASC, crw_org ASC
