b1nary0mega
1/27/2015 - 3:53 PM

Find an employee's position code for their current profile, making sure to zero out dates in the sql query; done via coldfusion

Find an employee's position code for their current profile, making sure to zero out dates in the sql query; done via coldfusion

<cfquery name="getEmplPos" datasource="#application.datasrc_mss#" dbtype="#application.dbtype_mss#">
    select pos_code
    from employee_profile
    where DOMAIN_ID = '#Session.DOMAIN_id#'
    and UNIT_ID = '#variables.UNIT_ID#'
    AND ( mss_unit_term_dt > <cfoutput>to_date('#DateFormat(NOW(),"mm-dd-yy")# 00:00:00','mm-dd-yy hh24:mi:ss')</cfoutput>
    	OR mss_unit_term_dt IS NULL )
    AND (
    	mss_unit_strt_dt <= <cfoutput>to_date('#DateFormat(NOW(),"mm-dd-yy")# 00:00:00','mm-dd-yy hh24:mi:ss')</cfoutput>
    )
</cfquery>