I have a query i thought was working until i added more values into the equation This has resulted in the rows in the results not matching the actual data.
Here is the Data set i am querying:
My Query:
SELECT c.Company_Name, c.Branch_Name, Till_No, Database_Build_Date, Database_Updated_Date, Touchkeys_Build_Date, Touchkeys_Updated_Date, MAX(DateTime)
FROM `TillDatabase`
INNER JOIN Customers c USING(ClientID, Branch)
WHERE `ClientID` = 1 AND `Branch` = 1
Group by Till_No
Order by Till_No Asc;
With the group by and using Max date, i would of expected only Till 1, 2 and 3 To show using the Latest Date
What have i failed to acknowledge or am i going about the query the wrong way?
Thanks
(Sorry I tried to format for table as it shows but i have no idea how to do it as it came out so badly formatted)