Jump to content

Difficult query


duetltd

Recommended Posts

It's possible. Assuming the `Date` field is of a date type, you can use this example:

 

This selects all customers that have not received calls in the past 30+ days.

SELECT cu.Name, ca.CusID

FROM Customers cu

INNER JOIN Calls ca

    ON (cu.CusID = ca.CusID)

WHERE DATE_SUB(CURDATE(), INTERVAL 30 DAY) > ca.Date;

Link to comment
https://forums.phpfreaks.com/topic/200410-difficult-query/#findComment-1051696
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.