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_AuthFormR ecDate<=[Start Date]
AND
clt_A21a_Record Type=10
AND
(
clt_A21_RecordS tatus=10 OR (clt_A23_DateCl osed>=[Start Date])
)
AND
(
(q01_Clients.cl t_A24_Departmen t=10 AND clt_A98_Transfe rred = FALSE)
OR
(q01_Clients.cl t_A24_Departmen t=10 AND clt_A99_DateTra nsferred
>=[Start Date])OR
(q01_Clients.cl t_A24_Departmen t=20 AND
(clt_A45_Resett lementOpenDate> =[Start Date] OR
clt_A45_Resettl ementOpenDate is NULL))
))
OR
(
q01_Clients.clt _A11c_AuthFormR ecDate BETWEEN [Start Date] AND [End
Date] AND q01_Clients.clt _A21a_RecordTyp e=10
));
Many thanks in anticipation!
Stephen