Query returning Dates outside input Dates

joseph.larrew

Registered User.
Local time
Today, 08:53
Joined
Oct 26, 2010
Messages
13
Hey all, I'm trying to run a query (that uses a subquery)that counts a couple things between a date entered by the user at the time of the query. When I enter the dates, it returns results outside the dates I entered. For instance, I enter 7/31 (July 31) as a begin date and 8/6 as an end date, and it gives me results from 7/4. Here is my code:

SUB LAME ASS:
SELECT EXSUMs.[EXSUM Date], EXSUMs.[IPA/West], EXSUMs.LOO, EXSUMs.Tone, EXSUMs.[EXSUM Body]
FROM EXSUMs
WHERE EXSUMs.[EXSUM Date] Between [Enter Begin Date] And [Enter End Date] AND EXSUMs.[IPA/West]=[Enter "I/PA" or "Western"];

LAME ASS:
SELECT [SUB LAME ASS].LOO, [SUB LAME ASS].Tone, Count([SUB LAME ASS].LOO) AS [LOO Count]
FROM [SUB LAME ASS]
GROUP BY [SUB LAME ASS].LOO, [SUB LAME ASS].Tone;

The first place I checked was my sub query and after I enter the dates, it returns results outside my parameters. What's going on?
 
A couple things to check:
Is [EXSUM Date] a date field in your table and not stored as text?
Are you passing it just "7/31" and "8/6" or are you included a year in there too?

Last, I think you might need to put a # before and after each date criteria like this:

...Between "#" & [Enter Begin Date] & "# And #" & [Enter End Date] & "#...
 

Users who are viewing this thread

Back
Top Bottom