Jesper Kampmann Jesper Kampmann - 1 year ago 68
PHP Question

Select all customers but not from current month

How can i get all customers, but not records that have signed up in CURRENT month? I thought this would work, but nope - what to do?

SELECT * FROM customers WHERE deleted = 0 AND (MONTH(created) != MONTH(NOW() AND YEAR(created) != YEAR(NOW())))

Answer Source
SELECT * FROM customers 
   WHERE (deleted = 0) AND  not (
         (MONTH(created) = MONTH(NOW()) AND 
         (YEAR(created) = YEAR(NOW()))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download