The following query is used to populate a combobox control source. The problem is that I cant seem to get it to work properly.
The form controls in the query are as follows:
Forms!LA_Monthly![CF_Month] is a month value like January or February
Forms!LA_Monthly![CF_Year] is a year value like 2010 or 2011
The goal is to get a distinct set of 'ScoreBin' for a given month
Code:
SELECT DISTINCT ScoreBin
FROM dbo_VLetterSent
WHERE LetterSentDt <= Datevalue('Forms!LA_Monthly![CF_Month] & " 31, " & Forms!LA_Monthly![CF_Year]') AND LetterSentDt >= Datevalue('Forms!LA_Monthly![CF_Month] & " 1, " & Forms!LA_Monthly![CF_Year]')
I've tried it multiple ways and can't seem to ge the syntax correct. Any help would be appreciated.