Just some questions regarding queries and the logic behind what I'm trying to achieve.
So basically, I have these rows of information inside a MSQL table called Customers. The columns are as follow:
id customer_name customer_name_letterhead customer_notes systype status signaltype verification address postcode telephone mobile mobiletwo email mainarea installation Contract expiration SPA nservice maintenance monitoring MS certdate
Now if we think about it, nservice is a date and is shortened for next service.
I want to query it so that IF nextservice is BEHIND the date we are currently at that it presents the following information of that customer:
Name, Mobile, Mobiletwo, Email, Address, nservicedate and How many days past it is.
I want this to be for each customer at said date, e.g
Bob | 123456 | 123456 | firstname.lastname@example.org | 25bob avenue | 28/01/2013 | 3 Days late |
Just really wanting to know about how these methods are done, and how to make it automatic when viewing that page? Also in the future to have CronJobs e.g If the day late is >10 then send them an email etc.