T
TheCaptain
Hello,
I am running a simple query and need it search through a range of dates and
years. So for example, something like this:
From: January From: 2005
To: August To: 2007
The search criteria is entered into a form and then you push a"Search"
button and the results are displayed on a form. The SQL coding I am using is
as follows:
Where ([month] Between Forms!CapSearch.mfrom And Forms!CapSearch.mto Or
[month] Between Forms!CapSearch.mfrom And Forms!CapSearch.mto IS NULL) AND
([year] Between Forms!CapSearch.yfrom And Forms!CapSearch.yto Or [year]
Between Forms!CapSearch.yfrom And Forms!CapSearch.yto IS NULL);
mfrom= Starting Month
mto=Finishing Month
yfrom= Starting Year
yto= Finishing Year
CapSearch= my form
I don't know why, but it works fine when I only enter the years. Perhaps I
have to specify that the Months are text?
I am running a simple query and need it search through a range of dates and
years. So for example, something like this:
From: January From: 2005
To: August To: 2007
The search criteria is entered into a form and then you push a"Search"
button and the results are displayed on a form. The SQL coding I am using is
as follows:
Where ([month] Between Forms!CapSearch.mfrom And Forms!CapSearch.mto Or
[month] Between Forms!CapSearch.mfrom And Forms!CapSearch.mto IS NULL) AND
([year] Between Forms!CapSearch.yfrom And Forms!CapSearch.yto Or [year]
Between Forms!CapSearch.yfrom And Forms!CapSearch.yto IS NULL);
mfrom= Starting Month
mto=Finishing Month
yfrom= Starting Year
yto= Finishing Year
CapSearch= my form
I don't know why, but it works fine when I only enter the years. Perhaps I
have to specify that the Months are text?