Help With SQL

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
 
G

Guest

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
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

bad query? 5
Access Dcount (multiple criteria) 3
Help with Union 2
Advance Help Needed With #num! 1
IIF question 3
Access Database Union 3 tables 6
Access form date query 1
Cdate funtion inconsistency 4

Top