Logic Question

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

Zane

I am trying to filter a query based on two date fields.
The first date field is the original date, and the second
is the modified date. What I want to do is grab all
entries in which either date field is in a certain
month.

For example:

I want only the entries with either the release date, or
the modified release date in february.

I don't do the actual programming stuff, I just use the
design view for the queries, so I type in my logic stuff
in the fields there (like excel).

Any help with this will be greatly appreciated. Thanks

Zane
 
A query similar to this will work.

SELECT Table1.*
FROM Table1
WHERE Month([ReleaseDate])=2 Or Month([ModifiedDate])=2;

This will give you all Februarys, not just this year. You could modify the
above to something similar to this if you wanted to limit it further. The
following query will return all records where either date matches today's
month and year.

SELECT Table1.*
FROM Table1
WHERE Format([ReleaseDate], "mmyyyy")=Format(Date(), "mmyyyy") Or
Format([ModifiedDate], "mmyyyy")=Format(Date(), "mmyyyy");
 
Thanks for your response with my problem. Where exactly
do I type those statements in? I do everything under the
design view that looks sort of like an excel
spreadsheet. It gives options of field, table, sort,
show, criteria, and or. I assume SELECT corresponds to
field, FROM to table, but does your WHERE correspond to
sort or criteria? Thanks again.


-----Original Message-----
A query similar to this will work.

SELECT Table1.*
FROM Table1
WHERE Month([ReleaseDate])=2 Or Month([ModifiedDate])=2;

This will give you all Februarys, not just this year. You could modify the
above to something similar to this if you wanted to limit it further. The
following query will return all records where either date matches today's
month and year.

SELECT Table1.*
FROM Table1
WHERE Format([ReleaseDate], "mmyyyy")=Format(Date (), "mmyyyy") Or
Format([ModifiedDate], "mmyyyy")=Format(Date (), "mmyyyy");

--
Wayne Morgan
Microsoft Access MVP


I am trying to filter a query based on two date fields.
The first date field is the original date, and the second
is the modified date. What I want to do is grab all
entries in which either date field is in a certain
month.

For example:

I want only the entries with either the release date, or
the modified release date in february.

I don't do the actual programming stuff, I just use the
design view for the queries, so I type in my logic stuff
in the fields there (like excel).

Any help with this will be greatly appreciated. Thanks

Zane


.
 
Back
Top