Created
June 22, 2012 18:37
-
-
Save barrychapman/2974435 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
DATE(DATE_ADD(NOW(), INTERVAL 2 DAY)) as `period_date`, | |
PrjPledge.id, | |
User.id, | |
Project.id | |
FROM | |
receivables AS Receivable | |
LEFT JOIN | |
prj_pledges AS PrjPledge ON (Receivable.pledge_id = PrjPledge.id) | |
LEFT JOIN | |
users AS User ON (Receivable.user_id = User.id) | |
LEFT JOIN | |
projects AS Project ON (Receivable.project_id = Project.id) | |
WHERE | |
HOUR(Receivable.due_by_date) = '14' AND | |
due_by_date <= `period_date` AND | |
due_by_date >= '2012-06-22 18:20:55' AND | |
Receivable.settled = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment