Help With SQL

  • Thread starter Thread starter Zane
  • Start date Start date
Z

Zane

I am getting some unexpected results from the filter that
I am tyring to use. The SQL looks like:

FROM [MAIN TABLE]
WHERE (((Month([DATE2]))>=[StartMonth] And (Month
([DATE2]))<=[EndMonth]) AND (([MAIN TABLE].AREA)="SEA"))
OR ((([MAIN TABLE].[DATE2]) Is Null) AND ((Month([DATE1]))
=[StartMonth] And (Month([DATE1]))<=[EndMonth]));


What I am trying to do with this is filter all entries
from the main table based on the area and a month range.
For example I want all entries in area SEA and from April
to May. I have tried getting help on here before and
nothing has worked. Any help would be greatly
appreciated. Thanks

Zane
 
I figured it out. It had to do with all those
parenthesis. Thanks anyway.

-----Original Message-----
I am getting some unexpected results from the filter that
I am tyring to use. The SQL looks like:

FROM [MAIN TABLE]
WHERE (((Month([DATE2]))>=[StartMonth] And (Month
([DATE2]))<=[EndMonth]) AND (([MAIN TABLE].AREA)="SEA"))
OR ((([MAIN TABLE].[DATE2]) Is Null) AND ((Month ([DATE1]))
=[StartMonth] And (Month([DATE1]))<=[EndMonth]));


What I am trying to do with this is filter all entries
from the main table based on the area and a month range.
For example I want all entries in area SEA and from April
to May. I have tried getting help on here before and
nothing has worked. Any help would be greatly
appreciated. Thanks

Zane
.
 
Back
Top