I can't seem to get dates that I have entered into two fields on a form into the BETWEEN . . .AND criteria in my query. I'm probably missing something simple, but I keep going around in circles. Here's my query:
SELECT tAGProjects.AGProjectKey AS [Project#], _
tAGProjects.ProjectTitle AS [Project Title], _
tAgents.AgentKey,tProjectArticleLog.DateSent AS _
[Date Sent]
FROM (tAgents INNER JOIN ((tAGProjects INNER JOIN _
tProjectArticleLog ON tAGProjects.AGProjectKey = _
tProjectArticleLog.AGProjectKey) INNER JOIN _
tProjectAgents ON tAGProjects.AGProjectKey = _
tProjectAgents.AGProjectKey) ON tAgents.AgentKey = _
tProjectAgents.AgentKey)
WHERE (((tAgents.AgentKey)=[Forms]![fAG_Articles]![cmbAgent].[Value]) AND ((tProjectArticleLog.DateSent) _
Between ([Forms]![fAG_Articles]![txtStartDate].[Text]) _
And ([Forms]![fAG_Articles]![txtEndDate].[Text])))
ORDER BY tProjectArticleLog.DateSent DESC;
I have code that runs this query when a command button is pressed on the form.
I appreciate the help!
GLGCAG
SELECT tAGProjects.AGProjectKey AS [Project#], _
tAGProjects.ProjectTitle AS [Project Title], _
tAgents.AgentKey,tProjectArticleLog.DateSent AS _
[Date Sent]
FROM (tAgents INNER JOIN ((tAGProjects INNER JOIN _
tProjectArticleLog ON tAGProjects.AGProjectKey = _
tProjectArticleLog.AGProjectKey) INNER JOIN _
tProjectAgents ON tAGProjects.AGProjectKey = _
tProjectAgents.AGProjectKey) ON tAgents.AgentKey = _
tProjectAgents.AgentKey)
WHERE (((tAgents.AgentKey)=[Forms]![fAG_Articles]![cmbAgent].[Value]) AND ((tProjectArticleLog.DateSent) _
Between ([Forms]![fAG_Articles]![txtStartDate].[Text]) _
And ([Forms]![fAG_Articles]![txtEndDate].[Text])))
ORDER BY tProjectArticleLog.DateSent DESC;
I have code that runs this query when a command button is pressed on the form.
I appreciate the help!
GLGCAG