Help with a date Expression

A

Alicia

Year([SalesDate]) = Year(Now()) And Month([SalesDate]) = Month(Now()).

I have several dates in one query. I would like to be able to make a
query the only showed the dates that expired in this month but when I
put the expression above in my query accross the board it requires
that all fields have to meet the criteria.

Pull each date in one query of my table and it works. I would just
like to be able to pull all my results into one report. I don't know
what to do. I have tried building relationships but I can't because
the queries are from the same table.
 
K

KARL DEWEY

I would like to be able to make a query the only showed the dates that
expired in this month
What would be an 'expired' date? Does it involved SalesDate? If so, how?
How does it require 'all fields have to meet the criteria'?

Post your complete SQL statement. Post sample data and what you want to
see in the query results.

--
KARL DEWEY
Build a little - Test a little


Alicia said:
Year([SalesDate]) = Year(Now()) And Month([SalesDate]) = Month(Now()).
 
A

Alicia

I am doing a select query for the dates expiring within the month.
Safety Card, Crane Certifications, Lincenses, and Phyicals.
s
If I pull the persons last name, first name, and Safety Card Exp Date.
I can use this criteria Year([Safety Card]) = Year(Now()) And
Month([Safety Card]) = Month(Now()) and it will pull the date that
expire in this month.

If I pull the person last name, first name and do the same query for
Safety Card, Crane Certification, Lincenses, and Phyiscal in one
query it will not bring up anything
I'll see if I can download a version of snag it to show you
 
L

Lord Kelvan

you need to put them on an or line rather than an and line

try the sql statement

select [first name],[last name], [Safety Card],[Crane Certification],
[Lincenses],[Phyiscal]
from [the table]
where (Year([Safety Card]) = Year(date()) And
Month([Safety Card]) = Month(date()))
or (Year([Crane Certification]) = Year(date()) And
Month([Crane Certification]) = Month(date()))
or (Year([Lincenses]) = Year(date()) And
Month([Lincenses]) = Month(date()))
or (Year([Phyiscal]) = Year(date()) And
Month([Phyiscal]) = Month(date()))

hope this helps

Regards
Kelvan
 
L

Lord Kelvan

as a note your query was working but it was looking for a person who
had everythign expired rather than one of the 4 expired

Regards
Kelvan
 

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

Top