I'm using Access 2003, and I have a query (written in SQL) which has
two parameters and asks the user for two dates. This has been working
fine. Today I modified the query, removing the paramerters and hard-
coding some dates in, in dd/mm/yy format. To my surprise I got a
different number of records returned. I then, as an experiment, change
the date format to dd/mm/yyyy. This again returned a different number
of records, different to both previous instances. When I use the
parameters I get the same result, irrespective of the date format
used. Has anybody come across anything liek this before - I've
searched here and can't see and previous postings, but apologies if
this has been covered before. The query is only using one table, so
it's nothing particularly complicated. The full query (with
parameters) is pasted below.
PARAMETERS [Start Date] DateTime, [End Date] DateTime;
SELECT q01_Clients.*
FROM q01_Clients
WHERE (
(
q01_Clients.clt_A11c_AuthFormRecDate<=[Start Date]
AND
clt_A21a_RecordType=10
AND
(
clt_A21_RecordStatus=10 OR (clt_A23_DateClosed>=[Start Date])
)
AND
(
(q01_Clients.clt_A24_Department=10 AND clt_A98_Transferred = FALSE)
OR
(q01_Clients.clt_A24_Department=10 AND clt_A99_DateTransferred
>=[Start Date])OR
(q01_Clients.clt_A24_Department=20 AND
(clt_A45_ResettlementOpenDate>=[Start Date] OR
clt_A45_ResettlementOpenDate is NULL))
))
OR
(
q01_Clients.clt_A11c_AuthFormRecDate BETWEEN [Start Date] AND [End
Date] AND q01_Clients.clt_A21a_RecordType=10
));
Many thanks in anticipation!
Stephen