This topic is locked
[SOLVED]

 MassMailer SQL Query

10/16/2019 5:42:04 AM
PHPRunner General questions
Tandy author

I have a little question maybe someone can help out with. I am using the MassMailer Template as a notice system. I would like to send out a notice when a lube is due for a truck. I have it all set up pretty good and working as for the main page. My problem is I use Alias as my as my time the lube is done. The SQL Query does not seem to pick up Alias right to send out the notice. Here is my table:

SELECT

id,

truck_id,

truck_number,

email,

service,

`date`,

done,

intervals,

mileage,

((done + intervals) - mileage) AS due

FROM truck_lube

ORDER BY ((done + intervals) - mileage), truck_number


Then here is my SQL Query I am using on the MassMailer:



SELECT * FROM truck_lube HAVING (due) <= 0


I have tied different ways and all I get is Unknown column errors?
Any help would be great.

Thank You

James

Tandy author 10/16/2019

Figured it out.. Needed to have the SQL Query as:



SELECT * FROM truck_lube HAVING ((done + intervals) - mileage) <= 0