Date range of MS Access query
am 16.04.2008 20:31:14 von jmarr02s
Here is the SQL code of my MS Access query.
SELECT [IBCCP Referral].[Caller ID], [IBCCP Referral].CallDate, [IBCCP
Referral].QualityAssuarnce
FROM [IBCCP Referral] INNER JOIN [IBCCP Agencies] ON [IBCCP
Referral].AgencyID = [IBCCP Agencies].ID
GROUP BY [IBCCP Referral].[Caller ID], [IBCCP Referral].CallDate,
[IBCCP Referral].QualityAssuarnce
HAVING ((([IBCCP Referral].CallDate) Between #9/4/2007# And
#1/8/2008#) AND (([IBCCP Referral].QualityAssuarnce)=False))
ORDER BY [IBCCP Referral].[Caller ID];
There is one record that contains a CallDate value of 1/8/2008.
I do not understand why my query does not return this value?
John
Re: Date range of MS Access query
am 16.04.2008 20:41:09 von Valdeva Crema
On Apr 16, 2:31 pm, zufie wrote:
> Here is the SQL code of my MS Access query.
>
> SELECT [IBCCP Referral].[Caller ID], [IBCCP Referral].CallDate, [IBCCP
> Referral].QualityAssuarnce
> FROM [IBCCP Referral] INNER JOIN [IBCCP Agencies] ON [IBCCP
> Referral].AgencyID = [IBCCP Agencies].ID
> GROUP BY [IBCCP Referral].[Caller ID], [IBCCP Referral].CallDate,
> [IBCCP Referral].QualityAssuarnce
> HAVING ((([IBCCP Referral].CallDate) Between #9/4/2007# And
> #1/8/2008#) AND (([IBCCP Referral].QualityAssuarnce)=False))
> ORDER BY [IBCCP Referral].[Caller ID];
>
> There is one record that contains a CallDate value of 1/8/2008.
>
> I do not understand why my query does not return this value?
>
> John
John,
"Between" is exclusive on the last entry (inclusive on the first) so
to get this record, you should use ...Between #9/4/2007# And
#1/9/2008#)...
Hope this helps!
Dee Dee
Re: Date range of MS Access query
am 16.04.2008 21:56:09 von fredg
On Wed, 16 Apr 2008 11:31:14 -0700 (PDT), zufie wrote:
> Here is the SQL code of my MS Access query.
>
> SELECT [IBCCP Referral].[Caller ID], [IBCCP Referral].CallDate, [IBCCP
> Referral].QualityAssuarnce
> FROM [IBCCP Referral] INNER JOIN [IBCCP Agencies] ON [IBCCP
> Referral].AgencyID = [IBCCP Agencies].ID
> GROUP BY [IBCCP Referral].[Caller ID], [IBCCP Referral].CallDate,
> [IBCCP Referral].QualityAssuarnce
> HAVING ((([IBCCP Referral].CallDate) Between #9/4/2007# And
> #1/8/2008#) AND (([IBCCP Referral].QualityAssuarnce)=False))
> ORDER BY [IBCCP Referral].[Caller ID];
>
> There is one record that contains a CallDate value of 1/8/2008.
>
> I do not understand why my query does not return this value?
>
> John
I would suspect that the date field includes a time value.
If that is so, you must add 1 day to the end date parameter.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail