I would like to add a date range parameter to the below SQL statement and cannot get the syntax correct. The statement below works fine as it is.
sSQL = "Select * from [tblSourcedHires] where SourceEmpSourcer = '" & strSourcerIDselected & "'"
The statement needs to look at a date range in the same table (field : SourceEmpStartDate). Both dtStartDateOfSourcerYear and dtEndDateOfSourcerYear are date variables and hold a valid date.
something like this added:
AND where SourceEmpStartDate > ‘# & dtStartDateOfSourcerYear & #’ < ‘# & dtEndDateOfSourcerYear & #’
Can someone help put the string together correctly?