Hello,
I am trying to sort based on the sum of a few tables, but it keeps prompting me for a value for Total. Any help in achieving this would be great! Thanks in advance:
I am trying to sort based on the sum of a few tables, but it keeps prompting me for a value for Total. Any help in achieving this would be great! Thanks in advance:
Code:
SELECT DISTINCTROW Customers.CustomerID, Customers.FirstName, Customers.LastName, Jobs.JobID, Jobs.Days, Jobs.SpringRaking, Jobs.LawnCutting, Jobs.FallLeaves, Jobs.SnowPlowing, Jobs.Labor, Jobs.Materials, Jobs.Misc, Sum(Jobs.SpringRaking + Jobs.LawnCutting + Jobs.FallLeaves + Jobs.SnowPlowing + Jobs.Labor + Jobs.Materials + Jobs.Misc) as Total FROM Customers INNER JOIN Jobs ON Customers.CustomerID =jobs.CustomerID GROUP BY Customers.CustomerID, Jobs.jobid, Customers.FirstName, Customers.LastName, Jobs.Days,Jobs.SpringRaking, Jobs.LawnCutting, Jobs.FallLeaves, Jobs.SnowPlowing, Jobs.Labor, Jobs.Materials, Jobs.Misc order by total asc;