I am asked to find clients who have purchased something in the variable defined by first month but not in the second_month or third_month. So if Jack bought somethin in the first_month and second_month he would not show up in this query only people who bought items in the first_month only.

Here are my variables:
SET @rundate:='2012-11-07';
/*SET @rundate:=current_date();*/
SET @first_month:=DATE_FORMAT((@rundate - interval 6 month),'%Y-%m-01');
SET @second_month:=DATE_FORMAT((@rundate - interval 5 month),'%Y-%m-01');
SET @third_month:=DATE_FORMAT((@rundate - interval 4 month),'%Y-%m-01');

This is what I thought would work for this assignment:

[MYSQL]SELECT DISTINCT c_id, c_name
FROM a_bkorders.bkv_CustOrders
WHERE order_date NOT IN(
SELECT order_date
FROM a_bkorders.bkv_CustOrders
WHERE order_date>@second_month AND order_date<@third_month
UNION
SELECT order_date
FROM a_bkorders.bkv_CustOrders
WHERE order_date>@third_month AND order_date<@third_month + interval 1 month)
AND order_date>@first_month AND order_date<@second_month;[/MYSQL]

Thanks in Advance,
Shayster