mysql select all records where a datetime field is less than a specified value
===

So I am trying to run a query that will select, in this case, clients that haven't had an appointment is X amount of time (2 weeks for instance).  It boils down to "show me a list of clients that haven't had an appointment in 2 weeks".  I'm attempting to solve this in php by doing something like:

    $date = new DateTime;
    $ago = new DateInterval('P2W');
    $target = $date->sub($ago);
    //query to select clients that aren't scheduled after the $target date
    $clients = ...;

Two tables involved, **appt_tbl**, and **clients_tbl**.  appt_tbl stores a client_id for each appointment record.

So essentially what I need is to select the "max" appointment for each client, and if it's < my $target date, include them in the query results.  I've tried various flavors of queries, queries with sub queries, but I'm stumbling on getting this query right.

My current attempt looks something like:

    select * from clients_tbl inner join (select client_id from appt_tbl where 
    MAX(appt_date_time) < '2012-07-22' group by client_id) appts on 
    appts.client_id = clients_tbl.client_id;

This should also include clients that have never been scheduled (IE won't appear in the appt_tbl), but not clients who have an appointment booked in the next two weeks.
