Criteria for query

G

Guest

The query in question is linked with two tables. Table One has the route No.
(Primary Key) while the child or table Two has the Action ID (Primary
Key) with the RouteId from table 1 as its foreign key.
I want to see the routes which have not been updated from date -30.
The query I have now is >(Date-30) in the Dateupdate. This show me all the
route that were updated. I want to only see those route that were not updated
in the last 30 days.
The only line that should be displayed are lines 2 and 4
Line Table1. RouteId Table2 ForeignK Table2. Action ID Table2.
Dateupdate
1 802 802 99
05-23-05
2 301 301 98
04-20-05
3 802 802 97
04-15-05
4 804 804 95
03-24-05
5 301 301 96
04-10-05
 
S

Steve Schapel

Nick,

Something like this?...

SELECT Table2.RouteID, Max(Table2.DateUpdate)
FROM Table2
GROUP BY Table2.RouteID
HAVING Max(Table2.DateUpdate)<(Date()-30)
 

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